From 620e92e880f8a011c5f465ea4fee2abf857d4ab2 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 6 Nov 2012 13:44:59 +0100 Subject: [PATCH] =?UTF-8?q?Add=20an=20option=20=E2=80=98use-binary-caches?= =?UTF-8?q?=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows disabling the use of binary caches, e.g. $ nix-build ... --option use-binary-caches false Note that $ nix-build ... --option binary-caches '' does not disable all binary caches, since the caches defined by channels will still be used. --- doc/manual/conf-file.xml | 10 ++++++++++ scripts/download-from-binary-cache.pl.in | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/doc/manual/conf-file.xml b/doc/manual/conf-file.xml index 2dc260b35..6a575b9e3 100644 --- a/doc/manual/conf-file.xml +++ b/doc/manual/conf-file.xml @@ -318,6 +318,16 @@ build-use-chroot = /dev /proc /bin + use-binary-caches + + If set to true (the default), + Nix will check the binary caches specified by + and related options to obtain + binary substitutes. + + + + binary-caches A list of URLs of binary caches, separated by diff --git a/scripts/download-from-binary-cache.pl.in b/scripts/download-from-binary-cache.pl.in index 74df79d8f..a018b3b2a 100644 --- a/scripts/download-from-binary-cache.pl.in +++ b/scripts/download-from-binary-cache.pl.in @@ -177,6 +177,10 @@ sub getAvailableCaches { return if $gotCaches; $gotCaches = 1; + return if + ($Nix::Config::config{"use-binary-caches"} // "true") eq "false" || + ($Nix::Config::config{"untrusted-use-binary-caches"} // "true") eq "false"; + sub strToList { my ($s) = @_; return map { s/\/+$//; $_ } split(/ /, $s);