File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -730,14 +730,27 @@ installNix() {
730730 readonly NIX_SSL_CERT_FILE=" $HOME /.nix-profile/etc/ssl/certs/ca-bundle.crt"
731731 export NIX_SSL_CERT_FILE
732732 }
733+
734+ subscribeChannels () {
735+ # Subscribe the user to the Nixpkgs channel and fetch it.
736+ trap ' subscribeChannelsRevert $LINENO $?' INT TERM ABRT QUIT
737+ subscribeChannelsRevert () {
738+ errorRevert " Received Error signal from line $1 "
739+ errorRevert " Reverting channels subscriptions: nixpkgs"
740+ " $nix " /bin/nix-channel --remove nixpkgs
741+ error "
742+
743+ Changes reverted.
744+ " " $2 "
745+ }
746+ readonly channelUrl=' https://nixos.org/channels/nixpkgs-unstable'
747+ print " Subscribing to channel: nixpkgs=$channelUrl "
748+ " $nix " /bin/nix-channel --add " $channelUrl "
749+ }
733750}
734751
735752}
736753echo " performing a single-user installation of Nix..." >&2
737- # Subscribe the user to the Nixpkgs channel and fetch it.
738- if ! $nix /bin/nix-channel --list | grep -q " ^nixpkgs " ; then
739- $nix /bin/nix-channel --add https://nixos.org/channels/nixpkgs-unstable
740- fi
741754if [ -z " $_NIX_INSTALLER_TEST " ]; then
742755 $nix /bin/nix-channel --update nixpkgs
743756fi
You can’t perform that action at this time.
0 commit comments