about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--scripts/nix-profile.sh.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/nix-profile.sh.in b/scripts/nix-profile.sh.in
index b18069d9408b..bc3dc719eb6f 100644
--- a/scripts/nix-profile.sh.in
+++ b/scripts/nix-profile.sh.in
@@ -43,7 +43,7 @@ fi
 
 # Set up secure multi-user builds: non-root users build through the
 # Nix daemon.
-if test "$USER" != root; then
+if [ "$USER" != root -a -e @localstatedir@/nix/daemon-socket/socket ]; then
     export NIX_REMOTE=daemon
 else
     unset NIX_REMOTE