about summary refs log tree commit diff
path: root/src/libstore/store-api.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2016-11-09T17·57+0100
committerEelco Dolstra <edolstra@gmail.com>2016-11-09T17·57+0100
commit4b8f1b0ec066a5b994747b1afd050f5f62d857f6 (patch)
treea946094a9e4a3a56cfe713b01cd7d27104d56b03 /src/libstore/store-api.hh
parent21c55ab3b54fc2db30ca53c572d24b38331f508c (diff)
parentb99c6e0e2959e90ddda14d8b318e4c7b1a508674 (diff)
Merge branch 'ssh-store' of https://github.com/shlevy/nix
Diffstat (limited to 'src/libstore/store-api.hh')
-rw-r--r--src/libstore/store-api.hh14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh
index 3057106ec142..6762852cf30e 100644
--- a/src/libstore/store-api.hh
+++ b/src/libstore/store-api.hh
@@ -5,6 +5,7 @@
 #include "crypto.hh"
 #include "lru-cache.hh"
 #include "sync.hh"
+#include "globals.hh"
 
 #include <atomic>
 #include <limits>
@@ -537,7 +538,7 @@ protected:
 };
 
 
-class LocalFSStore : public Store
+class LocalFSStore : public virtual Store
 {
 public:
     const Path rootDir;
@@ -604,12 +605,17 @@ void removeTempRoots();
    If ‘uri’ is empty, it defaults to ‘direct’ or ‘daemon’ depending on
    whether the user has write access to the local Nix store/database.
    set to true *unless* you're going to collect garbage. */
-ref<Store> openStoreAt(const std::string & uri);
+ref<Store> openStore(const std::string & uri = getEnv("NIX_REMOTE"));
 
 
-/* Open the store indicated by the ‘NIX_REMOTE’ environment variable. */
-ref<Store> openStore();
+enum StoreType {
+    tDaemon,
+    tLocal,
+    tOther
+};
+
 
+StoreType getStoreType(const std::string & uri = getEnv("NIX_REMOTE"), const std::string & stateDir = settings.nixStateDir);
 
 /* Return the default substituter stores, defined by the
    ‘substituters’ option and various legacy options like