about summary refs log tree commit diff
path: root/src/nix-worker/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-worker/main.cc')
-rw-r--r--src/nix-worker/main.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nix-worker/main.cc b/src/nix-worker/main.cc
index c8abe14299cd..80db782e90ba 100644
--- a/src/nix-worker/main.cc
+++ b/src/nix-worker/main.cc
@@ -269,6 +269,15 @@ static void performOp(Source & from, Sink & to, unsigned int op)
         break;
     }
 
+    case wopAddIndirectRoot: {
+        Path path = absPath(readString(from));
+        startWork();
+        store->addIndirectRoot(path);
+        stopWork();
+        writeInt(1, to);
+        break;
+    }
+
     case wopSyncWithGC: {
         startWork();
         store->syncWithGC();
@@ -473,6 +482,7 @@ void run(Strings args)
     else if (daemon) {
         if (setuidMode)
             throw Error("daemon cannot be started in setuid mode");
+        chdir("/");
         daemonLoop();
     }