From ef3199f782e536c598c99d6211359b9750c56054 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 22 Nov 2012 11:49:47 +0100 Subject: [PATCH] Add options for specifying binary caches Cherry-picked a4bcb26b1a3894022b08381079c2c402d49d611f. --- modules/services/misc/nix-daemon.nix | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/modules/services/misc/nix-daemon.nix b/modules/services/misc/nix-daemon.nix index a955fdd8d351..92e3b627f858 100644 --- a/modules/services/misc/nix-daemon.nix +++ b/modules/services/misc/nix-daemon.nix @@ -185,7 +185,30 @@ in you should increase this value. ''; }; + + binaryCaches = mkOption { + default = [ http://nixos.org/binary-cache ]; + type = types.list types.string; + description = '' + List of binary cache URLs used to obtain pre-built binaries + of Nix packages. + ''; + }; + + trustedBinaryCaches = mkOption { + default = [ ]; + example = [ http://hydra.nixos.org/ ]; + type = types.list types.string; + description = '' + List of binary cache URLs that non-root users can use (in + addition to those specified using + by passing + --option binary-caches to Nix commands. + ''; + }; + }; + }; @@ -216,6 +239,8 @@ in build-max-jobs = ${toString (config.nix.maxJobs)} build-use-chroot = ${if config.nix.useChroot then "true" else "false"} build-chroot-dirs = ${toString config.nix.chrootDirs} $(echo $extraPaths) + binary-caches = ${toString config.nix.binaryCaches} + trusted-binary-caches = ${toString config.nix.trustedBinaryCaches} $extraOptions END '';