about summary refs log tree commit diff
path: root/src/libstore/store-api.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/store-api.cc')
-rw-r--r--src/libstore/store-api.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index cea4b4b6ebcb..c6616a43d708 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -230,7 +230,7 @@ Path Store::computeStorePathForText(const string & name, const string & s,
 
 
 Store::Store(const Params & params)
-    : storeDir(settings.nixStore)
+    : storeDir(get(params, "store", settings.nixStore))
 {
 }
 
@@ -508,7 +508,8 @@ static RegisterStoreImplementation regStore([](
     else return 0;
 
     if (mode == mAuto) {
-        if (LocalStore::haveWriteAccess())
+        auto stateDir = get(params, "state", settings.nixStateDir);
+        if (access(stateDir.c_str(), R_OK | W_OK) == 0)
             mode = mLocal;
         else if (pathExists(settings.nixDaemonSocketFile))
             mode = mDaemon;