From da7a244f951993cde649f54c009397f96bb6e2c9 Mon Sep 17 00:00:00 2001 From: "Andrew R. M" Date: Tue, 20 May 2025 18:45:04 +0000 Subject: [PATCH] Fix nix installer up --- installers/install-nix.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/installers/install-nix.sh b/installers/install-nix.sh index 2f9ac14..0d00675 100755 --- a/installers/install-nix.sh +++ b/installers/install-nix.sh @@ -9,6 +9,10 @@ set -x # Abort installation if Nix is already installed if [ -d /nix/store ]; then exit 0 +elif ! [ -O /nix ]; then + # If we don't own /nix use sudo to chown it. + # If we can't sudo then nothing we do here will work so we just let this fail + sudo chown $UID /nix fi # Workaround to make a single user install work as root