1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-16 23:42:43 +01:00

Use the daemon when we don't have write access to the Nix database

This commit is contained in:
Eelco Dolstra 2016-01-31 10:19:14 +01:00
parent 4fa08f3edb
commit 9e7c1a4bbd
7 changed files with 57 additions and 13 deletions

View file

@ -50,14 +50,8 @@ void RemoteStore::openConnection(bool reserveSpace)
if (initialised) return;
initialised = true;
string remoteMode = getEnv("NIX_REMOTE");
if (remoteMode == "daemon")
/* Connect to a daemon that does the privileged work for
us. */
connectToDaemon();
else
throw Error(format("invalid setting for NIX_REMOTE, %1%") % remoteMode);
/* Connect to a daemon that does the privileged work for us. */
connectToDaemon();
from.fd = fdSocket;
to.fd = fdSocket;