nix-shell: Set $IN_NIX_SHELL

This allows scripts to distinguish between a real build and a Nix
shell.
This commit is contained in:
Eelco Dolstra 2013-07-19 14:32:05 +02:00
parent 48858ad5ca
commit 15e5ac8039

View file

@ -188,6 +188,8 @@ foreach my $expr (@exprs) {
$ENV{'NIX_STORE'} = $Nix::Config::storeDir; $ENV{'NIX_STORE'} = $Nix::Config::storeDir;
$ENV{$_} = $drv->{env}->{$_} foreach keys %{$drv->{env}}; $ENV{$_} = $drv->{env}->{$_} foreach keys %{$drv->{env}};
$ENV{'IN_NIX_SHELL'} = 1;
# Run a shell using the derivation's environment. For # Run a shell using the derivation's environment. For
# convenience, source $stdenv/setup to setup additional # convenience, source $stdenv/setup to setup additional
# environment variables and shell functions. Also don't lose # environment variables and shell functions. Also don't lose