aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-04-30 14:46:51 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-04-30 14:47:56 +0200
commit0135fd6ec4dcd15771008b867f28047e5c2bb605 (patch)
treea19ecb322388ae169efdd4a421a8a0f91a1f689e /src
parentefe6c186eabeb85830be7bef9aea4dd7eb2357e7 (diff)
nix dev-shell: Unset shellHook
This avoids inheriting the caller's shellHook, which can happen when running a dev-shell inside a dev-shell.
Diffstat (limited to 'src')
-rw-r--r--src/nix/shell.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nix/shell.cc b/src/nix/shell.cc
index f0ffceaa7..9c45a935d 100644
--- a/src/nix/shell.cc
+++ b/src/nix/shell.cc
@@ -172,6 +172,8 @@ struct Common : InstallableCommand, MixProfile
void makeRcScript(const BuildEnvironment & buildEnvironment, std::ostream & out)
{
+ out << "unset shellHook\n";
+
out << "nix_saved_PATH=\"$PATH\"\n";
for (auto & i : buildEnvironment.env) {