Merge pull request #1313 from neilmayhew/topic/cores

Propagate NIX_BUILD_CORES to nix-shell environments
This commit is contained in:
Domen Kožar 2017-08-02 15:02:25 +02:00 committed by GitHub
commit 3afb744185
1 changed files with 5 additions and 0 deletions

View File

@ -11,6 +11,8 @@ use Cwd;
binmode STDERR, ":encoding(utf8)";
Nix::Config::readConfig;
my $dryRun = 0;
my $verbose = 0;
my $runEnv = $0 =~ /nix-shell$/;
@ -279,6 +281,9 @@ foreach my $expr (@exprs) {
}
$ENV{'NIX_BUILD_TOP'} = $ENV{'TMPDIR'} = $ENV{'TEMPDIR'} = $ENV{'TMP'} = $ENV{'TEMP'} = $tmp;
$ENV{'NIX_STORE'} = $Nix::Config::storeDir;
if (defined $Nix::Config::config{"build-cores"}) {
$ENV{'NIX_BUILD_CORES'} = $Nix::Config::config{"build-cores"};
}
$ENV{$_} = $drv->{env}->{$_} foreach keys %{$drv->{env}};
# Run a shell using the derivation's environment. For