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; };
|
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 (
|
packages = eachSystem (
|
||||||
{ pkgs, system }:
|
{ pkgs, system }:
|
||||||
import ./packages.nix { inherit pkgs; }
|
import ./packages.nix { inherit pkgs; }
|
||||||
|
|
|
||||||
26
packages.nix
26
packages.nix
|
|
@ -4,14 +4,11 @@
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cargoManifest = (pkgs.lib.importTOML ./Cargo.toml).package;
|
cargoManifest = (pkgs.lib.importTOML ./Cargo.toml).package;
|
||||||
in
|
system-manager-unwrapped = pkgs.callPackage (
|
||||||
{
|
|
||||||
system-manager = pkgs.callPackage (
|
|
||||||
{
|
{
|
||||||
rustPlatform,
|
rustPlatform,
|
||||||
dbus,
|
dbus,
|
||||||
pkg-config,
|
pkg-config,
|
||||||
makeWrapper,
|
|
||||||
nix,
|
nix,
|
||||||
clippy,
|
clippy,
|
||||||
}:
|
}:
|
||||||
|
|
@ -31,7 +28,6 @@ in
|
||||||
buildInputs = [ dbus ];
|
buildInputs = [ dbus ];
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
pkg-config
|
pkg-config
|
||||||
makeWrapper
|
|
||||||
];
|
];
|
||||||
|
|
||||||
nativeCheckInputs = [
|
nativeCheckInputs = [
|
||||||
|
|
@ -41,12 +37,20 @@ in
|
||||||
preCheck = ''
|
preCheck = ''
|
||||||
${lib.getExe pkgs.cargo} clippy
|
${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