about summary refs log tree commit diff
path: root/scripts/nix-build.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/nix-build.in')
-rwxr-xr-xscripts/nix-build.in4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/nix-build.in b/scripts/nix-build.in
index 8e6f43a373a1..5d5769246609 100755
--- a/scripts/nix-build.in
+++ b/scripts/nix-build.in
@@ -152,6 +152,8 @@ for (my $n = 0; $n < scalar @ARGV; $n++) {
 
 @exprs = ("./default.nix") if scalar @exprs == 0;
 
+$ENV{'IN_NIX_SHELL'} = 1 if $runEnv;
+
 
 foreach my $expr (@exprs) {
 
@@ -193,8 +195,6 @@ foreach my $expr (@exprs) {
         $ENV{'NIX_STORE'} = $Nix::Config::storeDir;
         $ENV{$_} = $drv->{env}->{$_} foreach keys %{$drv->{env}};
 
-        $ENV{'IN_NIX_SHELL'} = 1;
-
         # Run a shell using the derivation's environment.  For
         # convenience, source $stdenv/setup to setup additional
         # environment variables and shell functions.  Also don't lose