File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -712,16 +712,28 @@ installNix() {
712712 "
713713 fi
714714 }
715+
716+ installCerts () {
717+ # Install an SSL certificate bundle.
718+ trap ' installCertsRevert $LINENO $?' INT TERM ABRT QUIT
719+ subscribeChannelsRevert () {
720+ errorRevert " Received Error signal from line $1 "
721+ errorRevert " Reverting installation of certificate bundle"
722+ " $nix /bin/nix-env" --uninstall " $cacert "
723+ error "
724+
725+ Changes reverted.
726+ " " $2 "
727+ }
728+ print ' Installing SSL certificate bundle.'
729+ " $nix /bin/nix-env" --install " $cacert "
730+ readonly NIX_SSL_CERT_FILE=" $HOME /.nix-profile/etc/ssl/certs/ca-bundle.crt"
731+ export NIX_SSL_CERT_FILE
732+ }
715733}
716734
717735}
718736echo " performing a single-user installation of Nix..." >&2
719- # Install an SSL certificate bundle.
720- if [ -z " $NIX_SSL_CERT_FILE " ] || ! [ -f " $NIX_SSL_CERT_FILE " ]; then
721- $nix /bin/nix-env -i " $cacert "
722- export NIX_SSL_CERT_FILE=" $HOME /.nix-profile/etc/ssl/certs/ca-bundle.crt"
723- fi
724-
725737# Subscribe the user to the Nixpkgs channel and fetch it.
726738if ! $nix /bin/nix-channel --list | grep -q " ^nixpkgs " ; then
727739 $nix /bin/nix-channel --add https://nixos.org/channels/nixpkgs-unstable
You can’t perform that action at this time.
0 commit comments