mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 07:53:19 +00:00
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
|
||||
# Nix daemon.
|
||||
if test "$USER" != root; then
|
||||
if [ "$USER" != root -o ! -w /nix/var/nix/db ]; then
|
||||
export NIX_REMOTE=daemon
|
||||
else
|
||||
export NIX_REMOTE=
|
||||
fi
|
||||
'';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user