-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
47 lines (38 loc) · 964 Bytes
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{ sources ? import ./nix/sources.nix, pkgs ? import sources.nixpkgs { } }:
with pkgs;
let
rust = pkgs.callPackage ./nix/rust.nix { };
srcNoTarget = dir:
builtins.filterSource
(path: type: type != "directory" || builtins.baseNameOf path != "target")
dir;
naersk = pkgs.callPackage sources.naersk {
rustc = rust;
cargo = rust;
};
dhallpkgs = import sources.easy-dhall-nix { inherit pkgs; };
src = srcNoTarget ./.;
bot = naersk.buildPackage {
inherit src;
doCheck = true;
buildInputs = [ ];
remapPathPrefix = true;
};
config = stdenv.mkDerivation {
pname = "bot-config";
version = "HEAD";
buildInputs = [ dhallpkgs.dhall-simple ];
# phases = "installPhase";
#
# installPhase = ''
# '';
};
in pkgs.stdenv.mkDerivation {
inherit (bot) name;
inherit src;
phases = "installPhase";
installPhase = ''
mkdir -p $out $out/bin
cp -rf ${bot}/bin/bot $out/bin/bot
'';
}