about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-07-19T12·32+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-07-19T12·32+0200
commit15e5ac80393f3b0a1be264e8cdaa8f048375b27d (patch)
tree17c4734d9b4f65d64038582d956e01ce15a292e0
parent48858ad5cabd03976330dff3d7aaa3d949ca09d6 (diff)
nix-shell: Set $IN_NIX_SHELL
This allows scripts to distinguish between a real build and a Nix
shell.
-rwxr-xr-xscripts/nix-build.in2
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/nix-build.in b/scripts/nix-build.in
index 404133ed8e83..b3a0f400f89c 100755
--- a/scripts/nix-build.in
+++ b/scripts/nix-build.in
@@ -188,6 +188,8 @@ 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