File tree 2 files changed +19
-11
lines changed
2 files changed +19
-11
lines changed Original file line number Diff line number Diff line change 34
34
{
35
35
lib = import ./nix/lib.nix { inherit nixpkgs ; } ;
36
36
37
+ # The unwrapped version takes nix from the PATH, it will fail if nix
38
+ # cannot be found.
39
+ # The wrapped version has a reference to the nix store path, so nix is
40
+ # part of its runtime closure.
37
41
packages = eachSystem (
38
42
{ pkgs , system } :
39
43
import ./packages.nix { inherit pkgs ; }
Original file line number Diff line number Diff line change 4
4
} :
5
5
let
6
6
cargoManifest = ( pkgs . lib . importTOML ./Cargo.toml ) . package ;
7
- in
8
- {
9
- system-manager = pkgs . callPackage (
7
+ system-manager-unwrapped = pkgs . callPackage (
10
8
{
11
9
rustPlatform ,
12
10
dbus ,
13
11
pkg-config ,
14
- makeWrapper ,
15
12
nix ,
16
13
clippy ,
17
14
} :
31
28
buildInputs = [ dbus ] ;
32
29
nativeBuildInputs = [
33
30
pkg-config
34
- makeWrapper
35
31
] ;
36
32
37
33
nativeCheckInputs = [
41
37
preCheck = ''
42
38
${ lib . getExe pkgs . cargo } clippy
43
39
'' ;
44
-
45
- # TODO: Is prefixing nix here the correct approach?
46
- postFixup = ''
47
- wrapProgram $out/bin/system-manager \
48
- --prefix PATH : ${ lib . makeBinPath [ nix ] }
49
- '' ;
50
40
}
51
41
) { } ;
42
+ in
43
+ {
44
+ inherit system-manager-unwrapped ;
45
+ system-manager =
46
+ pkgs . runCommand "system-manager"
47
+ {
48
+ nativeBuildInputs = [ pkgs . makeBinaryWrapper ] ;
49
+ }
50
+ ''
51
+ makeWrapper \
52
+ ${ system-manager-unwrapped } /bin/system-manager \
53
+ $out/bin/system-manager \
54
+ --prefix PATH : ${ lib . makeBinPath [ pkgs . nix ] }
55
+ '' ;
52
56
}
You can’t perform that action at this time.
0 commit comments