Merge pull request #15579 from abbradar/nixos-install-ssl

nixos-install: fix SSL certificate error

Changed files
+5 -6
nixos
modules
installer
+4 -6
nixos/modules/installer/tools/nixos-install.sh
···
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
if [ -n "$runChroot" ]; then
if ! [ -L $mountPoint/nix/var/nix/profiles/system ]; then
···
rm -f $mountPoint/etc/{resolv.conf,hosts}
cp -Lf /etc/resolv.conf /etc/hosts $mountPoint/etc/
+
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
+1
nixos/modules/installer/tools/tools.nix
···
inherit (pkgs) perl pathsFromGraph;
nix = config.nix.package.out;
nixClosure = pkgs.runCommand "closure"
{ exportReferencesGraph = ["refs" config.nix.package.out]; }
···
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]; }