Skip to content

Commit

Permalink
nix develop: do not assume that saved vars are set
Browse files Browse the repository at this point in the history
This fixes NixOS#6809
  • Loading branch information
jfly committed Jul 15, 2022
1 parent de28796 commit 04386f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/nix/develop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,10 @@ struct Common : InstallableCommand, MixProfile

out << "unset shellHook\n";

for (auto & var : savedVars)
for (auto & var : savedVars) {
out << fmt("%s=${%s:-}\n", var, var);
out << fmt("nix_saved_%s=\"$%s\"\n", var, var);
}

buildEnvironment.toBash(out, ignoreVars);

Expand Down

0 comments on commit 04386f7

Please sign in to comment.