Skip to content

Commit

Permalink
Merge pull request NixOS#5101 from fzakaria/faridzakaria/fix-nix-shell
Browse files Browse the repository at this point in the history
nix-shell --pure: Let it work for any derivation
  • Loading branch information
edolstra authored Aug 9, 2021
2 parents 4c5ce2a + fbf42c5 commit 27444d4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/nix-build/nix-build.cc
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,9 @@ static void main_nix_build(int argc, char * * argv)
"_nix_shell_clean_tmpdir; ") +
(pure ? "" : "[ -n \"$PS1\" ] && [ -e ~/.bashrc ] && source ~/.bashrc;") +
"%2%"
// always clear PATH.
// when nix-shell is run impure, we rehydrate it with the `p=$PATH` above
"unset PATH;"
"dontAddDisableDepTrack=1;\n"
+ structuredAttrsRC +
"\n[ -e $stdenv/setup ] && source $stdenv/setup; "
Expand Down

0 comments on commit 27444d4

Please sign in to comment.