Skip to content
Snippets Groups Projects
Commit ea59f393 authored by Eelco Dolstra's avatar Eelco Dolstra
Browse files

nix-shell: Set $IN_NIX_SHELL before evaluating

parent f4013b61
No related branches found
No related tags found
No related merge requests found
...@@ -152,6 +152,8 @@ for (my $n = 0; $n < scalar @ARGV; $n++) { ...@@ -152,6 +152,8 @@ for (my $n = 0; $n < scalar @ARGV; $n++) {
@exprs = ("./default.nix") if scalar @exprs == 0; @exprs = ("./default.nix") if scalar @exprs == 0;
$ENV{'IN_NIX_SHELL'} = 1 if $runEnv;
foreach my $expr (@exprs) { foreach my $expr (@exprs) {
...@@ -193,8 +195,6 @@ foreach my $expr (@exprs) { ...@@ -193,8 +195,6 @@ 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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment