|
14 | 14 | let |
15 | 15 | cargoManifest = (lib.importTOML ./Cargo.toml).package; |
16 | 16 | system-manager-unwrapped = rustPlatform.buildRustPackage { |
17 | | - pname = "system-manager"; |
18 | | - version = cargoManifest.version; |
19 | | - src = lib.fileset.toSource { |
20 | | - root = ./.; |
21 | | - fileset = lib.fileset.unions [ |
22 | | - ./Cargo.toml |
23 | | - ./Cargo.lock |
24 | | - ./src |
25 | | - ./test/rust |
26 | | - ]; |
27 | | - }; |
28 | | - |
29 | | - cargoLock.lockFile = ./Cargo.lock; |
30 | | - buildInputs = [ dbus ]; |
31 | | - nativeBuildInputs = [ |
32 | | - pkg-config |
| 17 | + pname = "system-manager"; |
| 18 | + version = cargoManifest.version; |
| 19 | + src = lib.fileset.toSource { |
| 20 | + root = ./.; |
| 21 | + fileset = lib.fileset.unions [ |
| 22 | + ./Cargo.toml |
| 23 | + ./Cargo.lock |
| 24 | + ./src |
| 25 | + ./test/rust |
33 | 26 | ]; |
| 27 | + }; |
34 | 28 |
|
35 | | - nativeCheckInputs = [ |
36 | | - clippy |
37 | | - nix |
38 | | - ]; |
| 29 | + cargoLock.lockFile = ./Cargo.lock; |
| 30 | + buildInputs = [ dbus ]; |
| 31 | + nativeBuildInputs = [ |
| 32 | + pkg-config |
| 33 | + ]; |
39 | 34 |
|
40 | | - preCheck = '' |
41 | | - ${lib.getExe cargo} clippy |
| 35 | + nativeCheckInputs = [ |
| 36 | + clippy |
| 37 | + nix |
| 38 | + ]; |
42 | 39 |
|
43 | | - # Stop the Nix command from trying to create /nix/var/nix/profiles. |
44 | | - # |
45 | | - # https://nix.dev/manual/nix/2.24/command-ref/new-cli/nix3-profile#profiles |
46 | | - export NIX_STATE_DIR=$TMPDIR |
47 | | - ''; |
48 | | - }; |
| 40 | + preCheck = '' |
| 41 | + ${lib.getExe cargo} clippy |
| 42 | +
|
| 43 | + # Stop the Nix command from trying to create /nix/var/nix/profiles. |
| 44 | + # |
| 45 | + # https://nix.dev/manual/nix/2.24/command-ref/new-cli/nix3-profile#profiles |
| 46 | + export NIX_STATE_DIR=$TMPDIR |
| 47 | + ''; |
| 48 | + }; |
49 | 49 | in |
50 | | - runCommand "system-manager" |
51 | | - { |
52 | | - nativeBuildInputs = [ makeBinaryWrapper ]; |
53 | | - passthru = { |
54 | | - # The unwrapped version takes nix from the PATH, it will fail if nix |
55 | | - # cannot be found. |
56 | | - # The wrapped version has a reference to the nix store path, so nix is |
57 | | - # part of its runtime closure. |
58 | | - unwrapped = system-manager-unwrapped; |
59 | | - }; |
60 | | - } |
61 | | - '' |
62 | | - makeWrapper \ |
63 | | - ${system-manager-unwrapped}/bin/system-manager \ |
64 | | - $out/bin/system-manager \ |
65 | | - --prefix PATH : ${lib.makeBinPath [ nix ]} |
66 | | - '' |
| 50 | +runCommand "system-manager" |
| 51 | + { |
| 52 | + nativeBuildInputs = [ makeBinaryWrapper ]; |
| 53 | + passthru = { |
| 54 | + # The unwrapped version takes nix from the PATH, it will fail if nix |
| 55 | + # cannot be found. |
| 56 | + # The wrapped version has a reference to the nix store path, so nix is |
| 57 | + # part of its runtime closure. |
| 58 | + unwrapped = system-manager-unwrapped; |
| 59 | + }; |
| 60 | + } |
| 61 | + '' |
| 62 | + makeWrapper \ |
| 63 | + ${system-manager-unwrapped}/bin/system-manager \ |
| 64 | + $out/bin/system-manager \ |
| 65 | + --prefix PATH : ${lib.makeBinPath [ nix ]} |
| 66 | + '' |
0 commit comments