mirror of
https://github.com/NixOS/nix
synced 2025-06-27 04:21:16 +02:00
* Skeleton of remote store implementation.
This commit is contained in:
parent
6ecb840fd1
commit
9cf1948993
4 changed files with 14 additions and 6 deletions
|
@ -1,5 +1,6 @@
|
|||
#include "store-api.hh"
|
||||
#include "globals.hh"
|
||||
#include "util.hh"
|
||||
|
||||
|
||||
namespace nix {
|
||||
|
@ -90,6 +91,7 @@ Path makeFixedOutputPath(bool recursive,
|
|||
|
||||
|
||||
#include "local-store.hh"
|
||||
#include "remote-store.hh"
|
||||
|
||||
|
||||
namespace nix {
|
||||
|
@ -100,7 +102,12 @@ boost::shared_ptr<StoreAPI> store;
|
|||
|
||||
boost::shared_ptr<StoreAPI> openStore(bool reserveSpace)
|
||||
{
|
||||
return boost::shared_ptr<StoreAPI>(new LocalStore(reserveSpace));
|
||||
string mode = getEnv("NIX_REMOTE");
|
||||
if (mode == "")
|
||||
return boost::shared_ptr<StoreAPI>(new LocalStore(reserveSpace));
|
||||
else if (mode == "slave")
|
||||
return boost::shared_ptr<StoreAPI>(new RemoteStore());
|
||||
else throw Error(format("invalid setting for NIX_REMOTE, `%1%'") % mode);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue