From fb40d73e23383224fc541911da95a894bbbcc2a4 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Sun, 9 Jul 2017 13:07:28 -0400 Subject: Switch to a fancy multi-user installer on Darwin --- scripts/install-nix-from-closure.sh | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'scripts/install-nix-from-closure.sh') diff --git a/scripts/install-nix-from-closure.sh b/scripts/install-nix-from-closure.sh index d4eb1c6fbeb9..dd826c423953 100644 --- a/scripts/install-nix-from-closure.sh +++ b/scripts/install-nix-from-closure.sh @@ -8,15 +8,8 @@ nix="@nix@" cacert="@cacert@" -# macOS support for 10.10 or higher -if [[ "$(uname -s)" = "Darwin" && $(($(sw_vers -productVersion | cut -d '.' -f 2))) -lt 10 ]]; then - echo "$0: macOS $(sw_vers -productVersion) is not supported, upgrade to 10.10 or higher" - exit 1 -fi - if ! [ -e "$self/.reginfo" ]; then echo "$0: incomplete installer (.reginfo is missing)" >&2 - exit 1 fi if [ -z "$USER" ]; then @@ -24,6 +17,23 @@ if [ -z "$USER" ]; then exit 1 fi +if [ -z "$HOME" ]; then + echo "$0: \$HOME is not set" >&2 + exit 1 +fi + +# macOS support for 10.10 or higher +if [ "$(uname -s)" = "Darwin" ]; then + if [ $(($(sw_vers -productVersion | cut -d '.' -f 2))) -lt 10 ]; then + echo "$0: macOS $(sw_vers -productVersion) is not supported, upgrade to 10.10 or higher" + exit 1 + fi + + printf '\e[1;31mSwitching to the Multi-User Darwin Installer\e[0m\n' + "$self/install-darwin-multi-user" + exit 0 +fi + if [ "$(id -u)" -eq 0 ]; then printf '\e[1;31mwarning: installing Nix as root is not supported by this script!\e[0m\n' fi -- cgit 1.4.1