From 0135fd6ec4dcd15771008b867f28047e5c2bb605 Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <edolstra@gmail.com>
Date: Thu, 30 Apr 2020 14:46:51 +0200
Subject: [PATCH] nix dev-shell: Unset shellHook

This avoids inheriting the caller's shellHook, which can happen when
running a dev-shell inside a dev-shell.
---
 src/nix/shell.cc | 2 ++
 1 file changed, 2 insertions(+)

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) {
-- 
GitLab