Skip to content

Commit ca02ac4

Browse files
committed
Install Nix: updateRepos()
rm old channel update
1 parent fc63410 commit ca02ac4

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

scripts/install-nix-from-closure.sh

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -747,14 +747,24 @@ installNix() {
747747
print "Subscribing to channel: nixpkgs=$channelUrl"
748748
"$nix"/bin/nix-channel --add "$channelUrl"
749749
}
750+
751+
updateRepos() {
752+
# Subscribe the user to the Nixpkgs channel and fetch it.
753+
trap 'updateReposRevert $LINENO $?' INT TERM ABRT QUIT
754+
updateReposRevert() {
755+
error "
756+
757+
Received Error signal from line $1
758+
" "$2"
759+
}
760+
print 'Pulling information from channel: nixpkgs'
761+
# nix-channel should be fully transactional, so no 'nix-channel --rollback'
762+
"$nix"/bin/nix-channel --update nixpkgs
763+
}
750764
}
751765

752766
}
753767
echo "performing a single-user installation of Nix..." >&2
754-
if [ -z "$_NIX_INSTALLER_TEST" ]; then
755-
$nix/bin/nix-channel --update nixpkgs
756-
fi
757-
758768
added=
759769
if [ -z "$NIX_INSTALLER_NO_MODIFY_PROFILE" ]; then
760770

0 commit comments

Comments
 (0)