diff options
Diffstat (limited to 'pkgs/misc/my-env/default.nix')
-rw-r--r-- | pkgs/misc/my-env/default.nix | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/pkgs/misc/my-env/default.nix b/pkgs/misc/my-env/default.nix index 1c0dc0cbfe9..ce7813b237c 100644 --- a/pkgs/misc/my-env/default.nix +++ b/pkgs/misc/my-env/default.nix @@ -58,7 +58,7 @@ { mkDerivation, substituteAll, pkgs }: { stdenv ? pkgs.stdenv, name, buildInputs ? [] - , propagatedBuildInputs ? [], gcc ? stdenv.gcc, cTags ? [], extraCmds ? "" + , propagatedBuildInputs ? [], gcc ? stdenv.cc, cTags ? [], extraCmds ? "" , cleanupCmds ? "", shell ? "${pkgs.bashInteractive}/bin/bash --norc"}: mkDerivation { @@ -72,20 +72,21 @@ mkDerivation { phases = [ "buildPhase" "fixupPhase" ]; setupNew = substituteAll { src = ../../stdenv/generic/setup.sh; - initialPath= (import ../../stdenv/common-path.nix) { inherit pkgs; }; inherit gcc; }; - buildPhase = '' + buildPhase = let + initialPath = import ../../stdenv/common-path.nix { inherit pkgs; }; + in '' set -x mkdir -p "$out/dev-envs" "$out/nix-support" "$out/bin" s="$out/nix-support/setup-new-modified" - cp "$setupNew" "$s" # shut some warning up.., do not use set -e sed -e 's@set -e@@' \ -e 's@assertEnvExists\s\+NIX_STORE@:@' \ -e 's@trap.*@@' \ - -i "$s" + -e '1i initialPath="${toString initialPath}"' \ + "$setupNew" > "$s" cat >> "$out/dev-envs/''${name/env-/}" << EOF nativeBuildInputs="$nativeBuildInputs" propagatedBuildInputs="$propagatedBuildInputs2" @@ -131,7 +132,7 @@ mkDerivation { echo "\$tmp/script"; source "\$tmp/script"; fi - rm -fr "\$tmp" + ${pkgs.coreutils}/bin/rm -fr "\$tmp" ${extraCmds} nix_cleanup() { @@ -140,7 +141,7 @@ mkDerivation { } export PATH - echo $name loaded + echo $name loaded >&2 trap nix_cleanup EXIT EOF |