diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-11-27 12:41:43 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-11-27 17:09:17 +0100 |
commit | 57f145a7f8c3bd01e5ac1927cb0e1b14658fa7aa (patch) | |
tree | 05147c66a1d3529eb9b6597d74153ba36162b03c /nixos/modules/services/misc/nix-daemon.nix | |
parent | c6529ac9eb03145449d0d8af4aa1123935a88a1a (diff) | |
download | nixpkgs-57f145a7f8c3bd01e5ac1927cb0e1b14658fa7aa.tar nixpkgs-57f145a7f8c3bd01e5ac1927cb0e1b14658fa7aa.tar.gz nixpkgs-57f145a7f8c3bd01e5ac1927cb0e1b14658fa7aa.tar.bz2 nixpkgs-57f145a7f8c3bd01e5ac1927cb0e1b14658fa7aa.tar.lz nixpkgs-57f145a7f8c3bd01e5ac1927cb0e1b14658fa7aa.tar.xz nixpkgs-57f145a7f8c3bd01e5ac1927cb0e1b14658fa7aa.tar.zst nixpkgs-57f145a7f8c3bd01e5ac1927cb0e1b14658fa7aa.zip |
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.
Diffstat (limited to 'nixos/modules/services/misc/nix-daemon.nix')
-rw-r--r-- | nixos/modules/services/misc/nix-daemon.nix | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/nixos/modules/services/misc/nix-daemon.nix b/nixos/modules/services/misc/nix-daemon.nix index 1aefe75931b..cca42aa1100 100644 --- a/nixos/modules/services/misc/nix-daemon.nix +++ b/nixos/modules/services/misc/nix-daemon.nix @@ -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 ''; |