about summary refs log tree commit diff
path: root/src/nix
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix')
-rw-r--r--src/nix/run.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/nix/run.cc b/src/nix/run.cc
index fcde540fc2d2..f016b04a1ec8 100644
--- a/src/nix/run.cc
+++ b/src/nix/run.cc
@@ -16,6 +16,8 @@ using namespace nix;
 
 std::string chrootHelperName = "__run_in_chroot";
 
+extern char * * environ;
+
 struct CmdRun : InstallablesCommand
 {
     Strings command = { "bash" };
@@ -85,7 +87,7 @@ struct CmdRun : InstallablesCommand
                 if (s) kept[var] = s;
             }
 
-            clearenv();
+            environ = nullptr;
 
             for (auto & var : kept)
                 setenv(var.first.c_str(), var.second.c_str(), 1);