* Enable nix-prefetch-url caching in nix-channel.
This commit is contained in:
parent
5e52df18fe
commit
911bc01454
|
@ -8,6 +8,12 @@ my $stateDir = $ENV{"NIX_STATE_DIR"};
|
|||
$stateDir = "@localstatedir@/nix" unless defined $stateDir;
|
||||
|
||||
|
||||
# Turn on caching in nix-prefetch-url.
|
||||
my $channelCache = "$stateDir/channel-cache";
|
||||
$ENV{'NIX_DOWNLOAD_CACHE'} = $channelCache;
|
||||
mkdir $channelCache, 0755 unless -e $channelCache;
|
||||
|
||||
|
||||
# Figure out the name of the `.nix-channels' file to use.
|
||||
my $home = $ENV{"HOME"};
|
||||
die '$HOME not set' unless defined $home;
|
||||
|
|
|
@ -17,9 +17,9 @@ $binDir = "@bindir@" unless defined $binDir;
|
|||
my $tmpDir = tempdir("nix-pack-closure.XXXXXX", CLEANUP => 1, TMPDIR => 1)
|
||||
or die "cannot create a temporary directory";
|
||||
|
||||
mkdir "$tmpDir/contents", 0777 or die;
|
||||
mkdir "$tmpDir/references", 0777 or die;
|
||||
mkdir "$tmpDir/derivers", 0777 or die;
|
||||
mkdir "$tmpDir/contents", 0755 or die;
|
||||
mkdir "$tmpDir/references", 0755 or die;
|
||||
mkdir "$tmpDir/derivers", 0755 or die;
|
||||
|
||||
open TOPLEVEL, ">$tmpDir/top-level" or die;
|
||||
|
||||
|
|
Loading…
Reference in a new issue