nix dev-shell: Unset shellHook

This avoids inheriting the caller's shellHook, which can happen when
running a dev-shell inside a dev-shell.
This commit is contained in:
Eelco Dolstra 2020-04-30 14:46:51 +02:00
parent efe6c186ea
commit 0135fd6ec4
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

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