Don't ever try to install Nix on NixOS

This commit is contained in:
Pedro Pombeiro 2019-05-06 15:16:31 +02:00
parent 3469c4a9b1
commit 69b9847c5f
No known key found for this signature in database
GPG Key ID: C4A24185B2AA48A1
1 changed files with 5 additions and 2 deletions

View File

@ -19,7 +19,10 @@ exit_unless_os_supported
####
setup_header "Checking prerequisites..."
if ! program_exists "curl"; then
_need_curl=0
! is_nixos && ! program_exists nix && _need_curl=1
if _need_curl && ! program_exists "curl"; then
cecho "@b@yellow[[Please install curl before running setup.]]"
exit 1
fi
@ -45,7 +48,7 @@ fi
####
setup_header "Installing requirements..."
if ! program_exists nix; then
if [ "$IN_NIX_SHELL" != 'pure' ] && ! is_nixos && ! program_exists nix; then
required_version=$(toolversion nix)
NIX_INSTALLER_NO_MODIFY_PROFILE=1 bash <(curl https://nixos.org/releases/nix/nix-${required_version}/install) --no-daemon
if [ $? -eq 0 ]; then