about summary refs log tree commit diff
path: root/src/libstore/store-api.hh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-02-24T13·48+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-02-24T13·48+0100
commit263187a2ec0a2ddd16cfd8c54c55e3455c9cd987 (patch)
tree1b39bcf8979f35fa9fb4b4dde6440219c9451b82 /src/libstore/store-api.hh
parentb584a0e7dea6fd903f8a285ee3a997ba535b44a7 (diff)
Move BinaryCacheStore / LocalBinaryCacheStore from Hydra
So you can now do:

  $ NIX_REMOTE=file:///tmp/binary-cache nix-store -qR /nix/store/...
Diffstat (limited to 'src/libstore/store-api.hh')
-rw-r--r--src/libstore/store-api.hh24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh
index 6f50e3c55aba..5fe42c973787 100644
--- a/src/libstore/store-api.hh
+++ b/src/libstore/store-api.hh
@@ -419,8 +419,28 @@ Path computeStorePathForText(const string & name, const string & s,
 void removeTempRoots();
 
 
-/* Factory method: open the Nix database, either through the local or
-   remote implementation. */
+/* Return a Store object to access the Nix store denoted by
+   ‘uri’ (slight misnomer...). Supported values are:
+
+   * ‘direct’: The Nix store in /nix/store and database in
+     /nix/var/nix/db, accessed directly.
+
+   * ‘daemon’: The Nix store accessed via a Unix domain socket
+     connection to nix-daemon.
+
+   * ‘file://<path>’: A binary cache stored in <path>.
+
+   If ‘uri’ is empty, it defaults to ‘direct’ or ‘daemon’ depending on
+   whether the user has write access to the local Nix store/database.
+
+   The Boolean ‘reserveSpace’ denotes whether some disk space should
+   be reserved to enable future garbage collector runs. It should be
+   set to true *unless* you're going to collect garbage.
+*/
+ref<Store> openStoreAt(const std::string & uri, bool reserveSpace = true);
+
+
+/* Open the store indicated by the ‘NIX_REMOTE’ environment variable. */
 ref<Store> openStore(bool reserveSpace = true);