diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-02-24 14:48:16 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-02-24 14:48:16 +0100 |
commit | 263187a2ec0a2ddd16cfd8c54c55e3455c9cd987 (patch) | |
tree | 1b39bcf8979f35fa9fb4b4dde6440219c9451b82 /src/libstore/local-binary-cache-store.hh | |
parent | b584a0e7dea6fd903f8a285ee3a997ba535b44a7 (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/local-binary-cache-store.hh')
-rw-r--r-- | src/libstore/local-binary-cache-store.hh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/libstore/local-binary-cache-store.hh b/src/libstore/local-binary-cache-store.hh new file mode 100644 index 000000000..0303ebe73 --- /dev/null +++ b/src/libstore/local-binary-cache-store.hh @@ -0,0 +1,31 @@ +#pragma once + +#include "binary-cache-store.hh" + +namespace nix { + +class LocalBinaryCacheStore : public BinaryCacheStore +{ +private: + + Path binaryCacheDir; + +public: + + LocalBinaryCacheStore(std::shared_ptr<Store> localStore, + const Path & secretKeyFile, const Path & publicKeyFile, + const Path & binaryCacheDir); + + void init() override; + +protected: + + bool fileExists(const std::string & path) override; + + void upsertFile(const std::string & path, const std::string & data) override; + + std::string getFile(const std::string & path) override; + +}; + +} |