From 863a45f1f3ac3ac5db6afcf906aa2c485418d9ac Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 23 Oct 2017 19:06:55 +0200 Subject: build-remote: Put current load under the store state directory Fixes the error error: opening lock file '/nix/var/nix/current-load/main-lock': Permission denied when using a chroot store. --- src/build-remote/build-remote.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/build-remote/build-remote.cc') diff --git a/src/build-remote/build-remote.cc b/src/build-remote/build-remote.cc index 4b7a24d03e9a..ea002cdccabb 100644 --- a/src/build-remote/build-remote.cc +++ b/src/build-remote/build-remote.cc @@ -16,6 +16,7 @@ #include "serialise.hh" #include "store-api.hh" #include "derivations.hh" +#include "local-store.hh" using namespace nix; using std::cin; @@ -48,7 +49,7 @@ int main (int argc, char * * argv) if (argc != 6) throw UsageError("called without required arguments"); - auto store = openStore(); + auto store = openStore().cast(); auto localSystem = argv[1]; settings.maxSilentTime = std::stoll(argv[2]); @@ -58,7 +59,7 @@ int main (int argc, char * * argv) /* It would be more appropriate to use $XDG_RUNTIME_DIR, since that gets cleared on reboot, but it wouldn't work on macOS. */ - currentLoad = settings.nixStateDir + "/current-load"; + currentLoad = store->stateDir + "/current-load"; std::shared_ptr sshStore; AutoCloseFD bestSlotLock; -- cgit 1.4.1