mirror of
https://github.com/NixOS/nix
synced 2025-07-17 18:38:28 +02:00
nix-channel: Use binary caches advertised by channels
Channels can now advertise a binary cache by creating a file <channel-url>/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.
This commit is contained in:
parent
79bba3782c
commit
5170c5691a
4 changed files with 49 additions and 20 deletions
|
@ -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}";
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue