diff options
Diffstat (limited to 'pkgs/misc/my-env')
-rw-r--r-- | pkgs/misc/my-env/default.nix | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/pkgs/misc/my-env/default.nix b/pkgs/misc/my-env/default.nix index 4e63cca439b4f..eb319b1c9b34b 100644 --- a/pkgs/misc/my-env/default.nix +++ b/pkgs/misc/my-env/default.nix @@ -45,7 +45,7 @@ mkDerivation { # the buildNativeInputs environment variable. buildNativeInputs = [ ] ++ buildInputs ; name = "env-${name}"; - phases = [ "buildPhase" ]; + phases = [ "buildPhase" "fixupPhase" ]; setupNew = substituteAll { src = ../../stdenv/generic/setup.sh; initialPath= (import ../../stdenv/common-path.nix) { inherit pkgs; }; @@ -54,7 +54,7 @@ mkDerivation { buildPhase = '' set -x - mkdir -p "$out/dev-envs" "$out/nix-support" + 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 @@ -109,6 +109,12 @@ mkDerivation { export PATH echo $name loaded EOF - exit 0 + + cat >> "$out/bin/load-''${name/env-/}-env" << EOF + #!/bin/sh + + source "$out/dev-envs/''${name/env-/}" + EOF + chmod +x "$out/bin/load-''${name/env-/}-env" ''; } |