aboutsummaryrefslogtreecommitdiff
path: root/nix/libstore/store-api.cc
diff options
context:
space:
mode:
Diffstat (limited to 'nix/libstore/store-api.cc')
-rw-r--r--nix/libstore/store-api.cc22
1 files changed, 17 insertions, 5 deletions
diff --git a/nix/libstore/store-api.cc b/nix/libstore/store-api.cc
index 0238e5b0b6..30af5f5fed 100644
--- a/nix/libstore/store-api.cc
+++ b/nix/libstore/store-api.cc
@@ -304,13 +304,28 @@ void exportPaths(StoreAPI & store, const Paths & paths,
writeInt(0, sink);
}
+Path readStorePath(Source & from)
+{
+ Path path = readString(from);
+ assertStorePath(path);
+ return path;
+}
+
+
+template<class T> T readStorePaths(Source & from)
+{
+ T paths = readStrings<T>(from);
+ foreach (typename T::iterator, i, paths) assertStorePath(*i);
+ return paths;
+}
+
+template PathSet readStorePaths(Source & from);
}
#include "local-store.hh"
#include "serialise.hh"
-#include "remote-store.hh"
namespace nix {
@@ -321,10 +336,7 @@ std::shared_ptr<StoreAPI> store;
std::shared_ptr<StoreAPI> openStore(bool reserveSpace)
{
- if (getEnv("NIX_REMOTE") == "")
- return std::shared_ptr<StoreAPI>(new LocalStore(reserveSpace));
- else
- return std::shared_ptr<StoreAPI>(new RemoteStore());
+ return std::shared_ptr<StoreAPI>(new LocalStore(reserveSpace));
}