Skip to content

Commit

Permalink
Merge pull request NixOS#6810 from jfly/jfly/do-not-assume-savedvars-…
Browse files Browse the repository at this point in the history
…exist

nix develop: do not assume that saved vars are set
  • Loading branch information
edolstra authored and Minion3665 committed Feb 23, 2023
2 parents 970d527 + cbcb0d6 commit ee085a1
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 ee085a1

Please sign in to comment.