diff options
Diffstat (limited to 'src/libstore/store-api.hh')
-rw-r--r-- | src/libstore/store-api.hh | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh index 6f50e3c55..5fe42c973 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); |