Merge pull request #216 from numtide/eureka-cpu/add-unwrapped
This commit is contained in:
commit
1027975497
2 changed files with 19 additions and 11 deletions
|
|
@ -34,6 +34,10 @@
|
|||
{
|
||||
lib = import ./nix/lib.nix { inherit nixpkgs; };
|
||||
|
||||
# The unwrapped version takes nix from the PATH, it will fail if nix
|
||||
# cannot be found.
|
||||
# The wrapped version has a reference to the nix store path, so nix is
|
||||
# part of its runtime closure.
|
||||
packages = eachSystem (
|
||||
{ pkgs, system }:
|
||||
import ./packages.nix { inherit pkgs; }
|
||||
|
|
|
|||
26
packages.nix
26
packages.nix
|
|
@ -4,14 +4,11 @@
|
|||
}:
|
||||
let
|
||||
cargoManifest = (pkgs.lib.importTOML ./Cargo.toml).package;
|
||||
in
|
||||
{
|
||||
system-manager = pkgs.callPackage (
|
||||
system-manager-unwrapped = pkgs.callPackage (
|
||||
{
|
||||
rustPlatform,
|
||||
dbus,
|
||||
pkg-config,
|
||||
makeWrapper,
|
||||
nix,
|
||||
clippy,
|
||||
}:
|
||||
|
|
@ -31,7 +28,6 @@ in
|
|||
buildInputs = [ dbus ];
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
nativeCheckInputs = [
|
||||
|
|
@ -41,12 +37,20 @@ in
|
|||
preCheck = ''
|
||||
${lib.getExe pkgs.cargo} clippy
|
||||
'';
|
||||
|
||||
# TODO: Is prefixing nix here the correct approach?
|
||||
postFixup = ''
|
||||
wrapProgram $out/bin/system-manager \
|
||||
--prefix PATH : ${lib.makeBinPath [ nix ]}
|
||||
'';
|
||||
}
|
||||
) { };
|
||||
in
|
||||
{
|
||||
inherit system-manager-unwrapped;
|
||||
system-manager =
|
||||
pkgs.runCommand "system-manager"
|
||||
{
|
||||
nativeBuildInputs = [ pkgs.makeBinaryWrapper ];
|
||||
}
|
||||
''
|
||||
makeWrapper \
|
||||
${system-manager-unwrapped}/bin/system-manager \
|
||||
$out/bin/system-manager \
|
||||
--prefix PATH : ${lib.makeBinPath [ pkgs.nix ]}
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue