forked from lix-project/lix
Merge pull request #5101 from fzakaria/faridzakaria/fix-nix-shell
nix-shell --pure: Let it work for any derivation
This commit is contained in:
commit
27444d40cf
|
@ -489,6 +489,9 @@ static void main_nix_build(int argc, char * * argv)
|
||||||
"_nix_shell_clean_tmpdir; ") +
|
"_nix_shell_clean_tmpdir; ") +
|
||||||
(pure ? "" : "[ -n \"$PS1\" ] && [ -e ~/.bashrc ] && source ~/.bashrc;") +
|
(pure ? "" : "[ -n \"$PS1\" ] && [ -e ~/.bashrc ] && source ~/.bashrc;") +
|
||||||
"%2%"
|
"%2%"
|
||||||
|
// always clear PATH.
|
||||||
|
// when nix-shell is run impure, we rehydrate it with the `p=$PATH` above
|
||||||
|
"unset PATH;"
|
||||||
"dontAddDisableDepTrack=1;\n"
|
"dontAddDisableDepTrack=1;\n"
|
||||||
+ structuredAttrsRC +
|
+ structuredAttrsRC +
|
||||||
"\n[ -e $stdenv/setup ] && source $stdenv/setup; "
|
"\n[ -e $stdenv/setup ] && source $stdenv/setup; "
|
||||||
|
|
Loading…
Reference in a new issue