Introduce NIX_INSTALLER_NO_CHANNEL_ADD which skips nix-channel --add

This commit is contained in:
Pavol Rusnak 2020-05-12 12:13:40 +02:00
parent 5bdb67c843
commit 46be11b762
No known key found for this signature in database
GPG key ID: 91F3B339B9A02A3D

View file

@ -130,13 +130,15 @@ if [ -z "$NIX_SSL_CERT_FILE" ] || ! [ -f "$NIX_SSL_CERT_FILE" ]; then
fi fi
# Subscribe the user to the Nixpkgs channel and fetch it. # Subscribe the user to the Nixpkgs channel and fetch it.
if ! $nix/bin/nix-channel --list | grep -q "^nixpkgs "; then if [ -z "$NIX_INSTALLER_NO_CHANNEL_ADD" ]; then
$nix/bin/nix-channel --add https://nixos.org/channels/nixpkgs-unstable if ! $nix/bin/nix-channel --list | grep -q "^nixpkgs "; then
fi $nix/bin/nix-channel --add https://nixos.org/channels/nixpkgs-unstable
if [ -z "$_NIX_INSTALLER_TEST" ]; then fi
if ! $nix/bin/nix-channel --update nixpkgs; then if [ -z "$_NIX_INSTALLER_TEST" ]; then
echo "Fetching the nixpkgs channel failed. (Are you offline?)" if ! $nix/bin/nix-channel --update nixpkgs; then
echo "To try again later, run \"nix-channel --update nixpkgs\"." echo "Fetching the nixpkgs channel failed. (Are you offline?)"
echo "To try again later, run \"nix-channel --update nixpkgs\"."
fi
fi fi
fi fi