about summary refs log tree commit diff
path: root/corepkgs/unpack-channel.nix
diff options
context:
space:
mode:
Diffstat (limited to 'corepkgs/unpack-channel.nix')
-rw-r--r--corepkgs/unpack-channel.nix10
1 files changed, 7 insertions, 3 deletions
diff --git a/corepkgs/unpack-channel.nix b/corepkgs/unpack-channel.nix
index bbc54c7d1e0d..57d5a09a076a 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}";