about summary refs log tree commit diff
path: root/nixos/modules/installer
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2016-06-23 07:48:45 +0400
committerGitHub <noreply@github.com>2016-06-23 07:48:45 +0400
commit21f9180d49d1d911668620f3d8897c1e1352672a (patch)
tree35933e477444f7d3c0a885721002232cd7372060 /nixos/modules/installer
parent25ae14aa38ad4e5e715e487981f302a4fcb082b5 (diff)
parent1193790b9534a9c8d063941841c3b20e7acf5b12 (diff)
downloadnixlib-21f9180d49d1d911668620f3d8897c1e1352672a.tar
nixlib-21f9180d49d1d911668620f3d8897c1e1352672a.tar.gz
nixlib-21f9180d49d1d911668620f3d8897c1e1352672a.tar.bz2
nixlib-21f9180d49d1d911668620f3d8897c1e1352672a.tar.lz
nixlib-21f9180d49d1d911668620f3d8897c1e1352672a.tar.xz
nixlib-21f9180d49d1d911668620f3d8897c1e1352672a.tar.zst
nixlib-21f9180d49d1d911668620f3d8897c1e1352672a.zip
Merge pull request #15579 from abbradar/nixos-install-ssl
nixos-install: fix SSL certificate error
Diffstat (limited to 'nixos/modules/installer')
-rw-r--r--nixos/modules/installer/tools/nixos-install.sh10
-rw-r--r--nixos/modules/installer/tools/tools.nix1
2 files changed, 5 insertions, 6 deletions
diff --git a/nixos/modules/installer/tools/nixos-install.sh b/nixos/modules/installer/tools/nixos-install.sh
index c23d7e5b509d..7962be137875 100644
--- a/nixos/modules/installer/tools/nixos-install.sh
+++ b/nixos/modules/installer/tools/nixos-install.sh
@@ -91,12 +91,10 @@ ln -s /run $mountPoint/var/run
 rm -f $mountPoint/etc/{resolv.conf,hosts}
 cp -Lf /etc/resolv.conf /etc/hosts $mountPoint/etc/
 
-if [ -e "$SSL_CERT_FILE" ]; then
-    cp -Lf "$SSL_CERT_FILE" "$mountPoint/tmp/ca-cert.crt"
-    export SSL_CERT_FILE=/tmp/ca-cert.crt
-    # For Nix 1.7
-    export CURL_CA_BUNDLE=/tmp/ca-cert.crt
-fi
+cp -Lf "@cacert@" "$mountPoint/tmp/ca-cert.crt"
+export SSL_CERT_FILE=/tmp/ca-cert.crt
+# For Nix 1.7
+export CURL_CA_BUNDLE=/tmp/ca-cert.crt
 
 if [ -n "$runChroot" ]; then
     if ! [ -L $mountPoint/nix/var/nix/profiles/system ]; then
diff --git a/nixos/modules/installer/tools/tools.nix b/nixos/modules/installer/tools/tools.nix
index b8fd9deaf1e4..d8622b510522 100644
--- a/nixos/modules/installer/tools/tools.nix
+++ b/nixos/modules/installer/tools/tools.nix
@@ -23,6 +23,7 @@ let
 
     inherit (pkgs) perl pathsFromGraph;
     nix = config.nix.package.out;
+    cacert = "${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt";
 
     nixClosure = pkgs.runCommand "closure"
       { exportReferencesGraph = ["refs" config.nix.package.out]; }