From 3cf6a1324bb2292d897c40dc77f61f97016ea5b6 Mon Sep 17 00:00:00 2001 From: DynamicApproach <89496209+DynamicApproach@users.noreply.github.com> Date: Sun, 9 Jul 2023 00:29:02 -0400 Subject: [PATCH] Multi-User fail if already has /nix --- scripts/install-multi-user.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/install-multi-user.sh b/scripts/install-multi-user.sh index 656769d84..a1d242337 100644 --- a/scripts/install-multi-user.sh +++ b/scripts/install-multi-user.sh @@ -58,6 +58,7 @@ readonly EXTRACTED_NIX_PATH="$(dirname "$0")" readonly ROOT_HOME=~root + if [ -t 0 ] && [ -z "${NIX_INSTALLER_YES:-}" ]; then readonly IS_HEADLESS='no' else @@ -96,6 +97,12 @@ is_os_darwin() { fi } +if [ -d "/nix" ]; then + echo "$(tput setaf 1)Error: /nix already exists on your system.$(tput sgr0)" + echo "$(tput setaf 2)To remove it, you can use the following command: sudo rm -rf /nix$(tput sgr0)" + exit 1 +fi + contact_us() { echo "You can open an issue at" echo "https://github.com/NixOS/nix/issues/new?labels=installer&template=installer.md"