diff options
author | Pavol Rusnak <pavol@rusnak.io> | 2020-05-12 12:13:40 +0200 |
---|---|---|
committer | Pavol Rusnak <pavol@rusnak.io> | 2020-05-12 12:13:40 +0200 |
commit | 46be11b762d6048746728e6e546dd4f0fac581fc (patch) | |
tree | 16646c29b4248b7ccae52e125124aaffc477451d /scripts/install-nix-from-closure.sh | |
parent | 5bdb67c84308a8cc78ac633d27b94eca87ea4390 (diff) |
Introduce NIX_INSTALLER_NO_CHANNEL_ADD which skips nix-channel --add
Diffstat (limited to 'scripts/install-nix-from-closure.sh')
-rw-r--r-- | scripts/install-nix-from-closure.sh | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/scripts/install-nix-from-closure.sh b/scripts/install-nix-from-closure.sh index e00708f6c..21915b37d 100644 --- a/scripts/install-nix-from-closure.sh +++ b/scripts/install-nix-from-closure.sh @@ -130,13 +130,15 @@ if [ -z "$NIX_SSL_CERT_FILE" ] || ! [ -f "$NIX_SSL_CERT_FILE" ]; then fi # Subscribe the user to the Nixpkgs channel and fetch it. -if ! $nix/bin/nix-channel --list | grep -q "^nixpkgs "; then - $nix/bin/nix-channel --add https://nixos.org/channels/nixpkgs-unstable -fi -if [ -z "$_NIX_INSTALLER_TEST" ]; then - if ! $nix/bin/nix-channel --update nixpkgs; then - echo "Fetching the nixpkgs channel failed. (Are you offline?)" - echo "To try again later, run \"nix-channel --update nixpkgs\"." +if [ -z "$NIX_INSTALLER_NO_CHANNEL_ADD" ]; then + if ! $nix/bin/nix-channel --list | grep -q "^nixpkgs "; then + $nix/bin/nix-channel --add https://nixos.org/channels/nixpkgs-unstable + fi + if [ -z "$_NIX_INSTALLER_TEST" ]; then + if ! $nix/bin/nix-channel --update nixpkgs; then + echo "Fetching the nixpkgs channel failed. (Are you offline?)" + echo "To try again later, run \"nix-channel --update nixpkgs\"." + fi fi fi |