From 911bc01454fba42b531f3f8dd0781845b045be63 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 10 Aug 2007 00:28:44 +0000 Subject: * Enable nix-prefetch-url caching in nix-channel. --- scripts/nix-channel.in | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts/nix-channel.in') diff --git a/scripts/nix-channel.in b/scripts/nix-channel.in index fd6639ec1b31..6a4603976fb9 100644 --- a/scripts/nix-channel.in +++ b/scripts/nix-channel.in @@ -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; -- cgit 1.4.1