static-nix-shell: avoid wrapping when not necessary
i guess this would be a minor perf gain in places
This commit is contained in:
parent
c7c90a9fa3
commit
699c4301b4
|
@ -50,6 +50,7 @@ in rec {
|
||||||
# allow any package to be a list of packages, to support things like
|
# allow any package to be a list of packages, to support things like
|
||||||
# -p python3Packages.foo.propagatedBuildInputs
|
# -p python3Packages.foo.propagatedBuildInputs
|
||||||
pkgsEnv' = lib.flatten pkgsEnv;
|
pkgsEnv' = lib.flatten pkgsEnv;
|
||||||
|
doWrap = pkgsEnv' != [];
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation ({
|
stdenv.mkDerivation ({
|
||||||
version = "0.1.0"; # default version
|
version = "0.1.0"; # default version
|
||||||
|
@ -69,9 +70,11 @@ in rec {
|
||||||
# ensure that all nix-shell references were substituted
|
# ensure that all nix-shell references were substituted
|
||||||
(! grep nix-shell $out/bin/${srcPath}) || exit 1
|
(! grep nix-shell $out/bin/${srcPath}) || exit 1
|
||||||
|
|
||||||
|
'' + lib.optionalString doWrap ''
|
||||||
# add runtime dependencies to PATH
|
# add runtime dependencies to PATH
|
||||||
wrapProgram $out/bin/${srcPath} \
|
wrapProgram $out/bin/${srcPath} \
|
||||||
--suffix PATH : ${lib.makeBinPath pkgsEnv' }
|
--suffix PATH : ${lib.makeBinPath pkgsEnv' }
|
||||||
|
'' + ''
|
||||||
|
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user