mirror of
https://github.com/NixOS/nix
synced 2025-06-25 19:01:16 +02:00
Make store implementations pluggable
This for instance allows hydra-queue-runner to add the S3 backend at runtime.
This commit is contained in:
parent
6055d84beb
commit
68a5414982
3 changed files with 50 additions and 19 deletions
|
@ -41,4 +41,13 @@ std::string LocalBinaryCacheStore::getFile(const std::string & path)
|
|||
return readFile(binaryCacheDir + "/" + path);
|
||||
}
|
||||
|
||||
static RegisterStoreImplementation regStore([](const std::string & uri) -> std::shared_ptr<Store> {
|
||||
if (std::string(uri, 0, 7) != "file://") return 0;
|
||||
auto store = std::make_shared<LocalBinaryCacheStore>(std::shared_ptr<Store>(0),
|
||||
"", "", // FIXME: allow the signing key to be set
|
||||
std::string(uri, 7));
|
||||
store->init();
|
||||
return store;
|
||||
});
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue