diff --git a/nixos/doc/manual/administration/network-problems.xml b/nixos/doc/manual/administration/network-problems.xml
index 5ba1bfd5ac9a..3af9cc59742f 100644
--- a/nixos/doc/manual/administration/network-problems.xml
+++ b/nixos/doc/manual/administration/network-problems.xml
@@ -12,9 +12,9 @@ pre-built binary. That is, whenever a command like
nixos-rebuild needs a path in the Nix store, Nix
will try to download that path from the Internet rather than build it
from source. The default binary cache is
-http://cache.nixos.org/. If this cache is unreachable, Nix
-operations may take a long time due to HTTP connection timeouts. You
-can disable the use of the binary cache by adding , e.g.
@@ -30,4 +30,4 @@ $ nixos-rebuild switch --option binary-caches http://my-cache.example.org/
-
\ No newline at end of file
+
diff --git a/nixos/modules/installer/tools/nixos-rebuild.sh b/nixos/modules/installer/tools/nixos-rebuild.sh
index 5daa9ff9457c..93f258f54e3e 100644
--- a/nixos/modules/installer/tools/nixos-rebuild.sh
+++ b/nixos/modules/installer/tools/nixos-rebuild.sh
@@ -156,7 +156,7 @@ if [ -n "$buildNix" ]; then
exit 1
fi
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
fi
# Older version of nix-store -r don't support --add-root.
diff --git a/nixos/modules/services/misc/nix-daemon.nix b/nixos/modules/services/misc/nix-daemon.nix
index d041c5664ef6..e9aa10181789 100644
--- a/nixos/modules/services/misc/nix-daemon.nix
+++ b/nixos/modules/services/misc/nix-daemon.nix
@@ -225,7 +225,7 @@ in
binaryCaches = mkOption {
type = types.listOf types.str;
- default = [ http://cache.nixos.org/ ];
+ default = [ https://cache.nixos.org/ ];
description = ''
List of binary cache URLs used to obtain pre-built binaries
of Nix packages.
diff --git a/nixos/tests/installer.nix b/nixos/tests/installer.nix
index 4f55f7242bff..641ff924e14e 100644
--- a/nixos/tests/installer.nix
+++ b/nixos/tests/installer.nix
@@ -29,6 +29,10 @@ let
pkgs.unionfs-fuse
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;
@@ -59,6 +63,8 @@ let
${optionalString (!readOnly) "nix.readOnlyStore = false;"}
environment.systemPackages = [ ${optionalString testChannel "pkgs.rlwrap"} ];
+
+ nix.binaryCaches = [ http://cache.nixos.org/ ];
}
'';