-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
46 lines (42 loc) · 1.48 KB
/
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
args@{
system ? builtins.currentSystem,
nixpkgsMozilla ? builtins.fetchGit {
url = https://github.com/mozilla/nixpkgs-mozilla;
rev = "18cd4300e9bf61c7b8b372f07af827f6ddc835bb";
},
cargo2nix ? builtins.fetchGit {
url = https://github.com/cargo2nix/cargo2nix;
ref = "master";
},
}:
let
rustOverlay = import "${nixpkgsMozilla}/rust-overlay.nix";
cargo2nixOverlay = import "${cargo2nix}/overlay";
pkgs = import <nixpkgs> {
inherit system;
overlays = [ cargo2nixOverlay rustOverlay ];
};
rustPkgs = pkgs.rustBuilder.makePackageSet' {
rustChannel = "stable";
packageFun = import ./Cargo.nix;
packageOverrides = pkgs: pkgs.rustBuilder.overrides.all ++ [
(pkgs.rustBuilder.rustLib.makeOverride {
name = "launchnix";
overrideAttrs = drv: {
buildInputs = drv.buildInputs ++ [ pkgs.makeWrapper ];
propagatedNativeBuildInputs = drv.propagatedNativeBuildInputs or [ ] ++ [
pkgs.libvirt
];
installPhase = drv.installPhase + ''
mv $bin/bin/launchnix $bin/bin/launchnix-bin
makeWrapper $bin/bin/launchnix-bin $bin/bin/launchnix --set PATH ${ pkgs.lib.makeBinPath [ pkgs.morph pkgs.nix pkgs.gnutar pkgs.gzip pkgs.git pkgs.openssh ] }
cp -r $src/nix $bin/bin/
'';
};
})
];
localPatterns = [ ''^(src|nix)(/.*)?'' ''[^/]*\.(rs|toml)$'' ];
};
in {
launchnix = rustPkgs.workspace.launchnix {};
}