From 5170c5691aac1bd6abc69be65cf880316e11fe24 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 1 Aug 2012 17:56:11 -0400 Subject: nix-channel: Use binary caches advertised by channels Channels can now advertise a binary cache by creating a file /binary-cache-url. The channel unpacker puts these in its "binary-caches" subdirectory. Thus, the URLS of the binary caches for the channels added by root appear in /nix/var/nix/profiles/per-user/eelco/channels/binary-caches/*. The binary cache substituter reads these and adds them to the list of binary caches. --- corepkgs/unpack-channel.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'corepkgs') diff --git a/corepkgs/unpack-channel.nix b/corepkgs/unpack-channel.nix index bbc54c7d1e..57d5a09a07 100644 --- a/corepkgs/unpack-channel.nix +++ b/corepkgs/unpack-channel.nix @@ -6,19 +6,23 @@ let '' mkdir $out cd $out - ${bzip2} -d < $src | ${tar} xf - --warning=no-timestamp + ${bzip2} -d < $src | ${tar} xf - --warning=no-timestamp mv * $out/$channelName + if [ -n "$binaryCacheURL" ]; then + mkdir $out/binary-caches + echo -n "$binaryCacheURL" > $out/binary-caches/$channelName + fi ''; in -{ name, channelName, src }: +{ name, channelName, src, binaryCacheURL ? "" }: derivation { system = builtins.currentSystem; builder = shell; args = [ "-e" builder ]; - inherit name channelName src; + inherit name channelName src binaryCacheURL; PATH = "${nixBinDir}:${coreutils}"; -- cgit 1.4.1