This commit is contained in:
Eelco Dolstra 2014-12-09 13:27:00 +01:00
parent fe28966179
commit faf0797c0c
4 changed files with 12 additions and 6 deletions

View file

@ -12,9 +12,9 @@ pre-built binary. That is, whenever a command like
<command>nixos-rebuild</command> needs a path in the Nix store, Nix <command>nixos-rebuild</command> needs a path in the Nix store, Nix
will try to download that path from the Internet rather than build it will try to download that path from the Internet rather than build it
from source. The default binary cache is from source. The default binary cache is
<uri>http://cache.nixos.org/</uri>. If this cache is unreachable, Nix <uri>https://cache.nixos.org/</uri>. If this cache is unreachable,
operations may take a long time due to HTTP connection timeouts. You Nix operations may take a long time due to HTTP connection timeouts.
can disable the use of the binary cache by adding <option>--option You can disable the use of the binary cache by adding <option>--option
use-binary-caches false</option>, e.g. use-binary-caches false</option>, e.g.
<screen> <screen>
@ -30,4 +30,4 @@ $ nixos-rebuild switch --option binary-caches http://my-cache.example.org/
</para> </para>
</section> </section>

View file

@ -156,7 +156,7 @@ if [ -n "$buildNix" ]; then
exit 1 exit 1
fi fi
if ! nix-store -r $nixStorePath --add-root $tmpDir/nix --indirect \ if ! nix-store -r $nixStorePath --add-root $tmpDir/nix --indirect \
--option extra-binary-caches http://cache.nixos.org/; then --option extra-binary-caches https://cache.nixos.org/; then
echo "warning: don't know how to get latest Nix" >&2 echo "warning: don't know how to get latest Nix" >&2
fi fi
# Older version of nix-store -r don't support --add-root. # Older version of nix-store -r don't support --add-root.

View file

@ -225,7 +225,7 @@ in
binaryCaches = mkOption { binaryCaches = mkOption {
type = types.listOf types.str; type = types.listOf types.str;
default = [ http://cache.nixos.org/ ]; default = [ https://cache.nixos.org/ ];
description = '' description = ''
List of binary cache URLs used to obtain pre-built binaries List of binary cache URLs used to obtain pre-built binaries
of Nix packages. of Nix packages.

View file

@ -29,6 +29,10 @@ let
pkgs.unionfs-fuse pkgs.unionfs-fuse
pkgs.gummiboot pkgs.gummiboot
]; ];
# Don't use https://cache.nixos.org since the fake
# cache.nixos.org doesn't do https.
nix.binaryCaches = [ http://cache.nixos.org/ ];
} }
]; ];
}).config.system.build.isoImage; }).config.system.build.isoImage;
@ -59,6 +63,8 @@ let
${optionalString (!readOnly) "nix.readOnlyStore = false;"} ${optionalString (!readOnly) "nix.readOnlyStore = false;"}
environment.systemPackages = [ ${optionalString testChannel "pkgs.rlwrap"} ]; environment.systemPackages = [ ${optionalString testChannel "pkgs.rlwrap"} ];
nix.binaryCaches = [ http://cache.nixos.org/ ];
} }
''; '';