When setting $NIX_REMOTE, check whether /nix/var/nix/db is writable
In NixOS containers, root doesn't have write permission to /nix/var/nix/db, so it has to use the daemon.
This commit is contained in:
parent
c6529ac9eb
commit
57f145a7f8
@ -334,10 +334,8 @@ in
|
|||||||
''
|
''
|
||||||
# Set up secure multi-user builds: non-root users build through the
|
# Set up secure multi-user builds: non-root users build through the
|
||||||
# Nix daemon.
|
# Nix daemon.
|
||||||
if test "$USER" != root; then
|
if [ "$USER" != root -o ! -w /nix/var/nix/db ]; then
|
||||||
export NIX_REMOTE=daemon
|
export NIX_REMOTE=daemon
|
||||||
else
|
|
||||||
export NIX_REMOTE=
|
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user