aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-07-15 13:59:25 +0200
committerGitHub <noreply@github.com>2022-07-15 13:59:25 +0200
commit59764eb842d0da4f6fcf4ce4b85bf02ac1ae26fc (patch)
treeaf5cdadf9ab4e9b1055fac63ec7ddb345d5bd960 /src
parent0621e99414f5907b72dc48fa23e719be1ec23ad8 (diff)
parent04386f7d69d9c370eb4367ca41d89ac5990ac02e (diff)
Merge pull request #6810 from jfly/jfly/do-not-assume-savedvars-exist
nix develop: do not assume that saved vars are set
Diffstat (limited to 'src')
-rw-r--r--src/nix/develop.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nix/develop.cc b/src/nix/develop.cc
index 6d9ad9942..ba7ba7c25 100644
--- a/src/nix/develop.cc
+++ b/src/nix/develop.cc
@@ -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);