1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-09-18 10:30:23 -04:00

Multi-User fail if already has /nix

This commit is contained in:
DynamicApproach 2023-07-09 00:29:02 -04:00 committed by GitHub
parent 8d871e1822
commit 3cf6a1324b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"