summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2016-05-20 15:30:56 +0300
committerNikolay Amiantov <ab@fmap.me>2016-05-20 15:30:56 +0300
commit1193790b9534a9c8d063941841c3b20e7acf5b12 (patch)
treebd141f6e8224b97d7e4165d6563e6ae5b5db6125 /nixos
parentca383765661bb5d977546f614d93af281f6a4393 (diff)
downloadnixpkgs-1193790b9534a9c8d063941841c3b20e7acf5b12.tar
nixpkgs-1193790b9534a9c8d063941841c3b20e7acf5b12.tar.gz
nixpkgs-1193790b9534a9c8d063941841c3b20e7acf5b12.tar.bz2
nixpkgs-1193790b9534a9c8d063941841c3b20e7acf5b12.tar.lz
nixpkgs-1193790b9534a9c8d063941841c3b20e7acf5b12.tar.xz
nixpkgs-1193790b9534a9c8d063941841c3b20e7acf5b12.tar.zst
nixpkgs-1193790b9534a9c8d063941841c3b20e7acf5b12.zip
nixos-install: fix SSL certificate error
Diffstat (limited to 'nixos')
-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 c23d7e5b509..7962be13787 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 b8fd9deaf1e..d8622b51052 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]; }