mirror of
https://github.com/NixOS/nix
synced 2025-06-24 22:11:15 +02:00
Merge pull request #13192 from NixOS/store-open-reg-header
Factor out `resolveStoreConfig`
This commit is contained in:
commit
1b22f0252d
2 changed files with 13 additions and 4 deletions
|
@ -15,6 +15,11 @@
|
|||
|
||||
namespace nix {
|
||||
|
||||
/**
|
||||
* @return The store config denoted by `storeURI` (slight misnomer...).
|
||||
*/
|
||||
ref<StoreConfig> resolveStoreConfig(StoreReference && storeURI);
|
||||
|
||||
/**
|
||||
* @return a Store object to access the Nix store denoted by
|
||||
* ‘uri’ (slight misnomer...).
|
||||
|
|
|
@ -11,6 +11,13 @@ ref<Store> openStore(const std::string & uri, const Store::Config::Params & extr
|
|||
}
|
||||
|
||||
ref<Store> openStore(StoreReference && storeURI)
|
||||
{
|
||||
auto store = resolveStoreConfig(std::move(storeURI))->openStore();
|
||||
store->init();
|
||||
return store;
|
||||
}
|
||||
|
||||
ref<StoreConfig> resolveStoreConfig(StoreReference && storeURI)
|
||||
{
|
||||
auto & params = storeURI.params;
|
||||
|
||||
|
@ -58,10 +65,7 @@ ref<Store> openStore(StoreReference && storeURI)
|
|||
experimentalFeatureSettings.require(storeConfig->experimentalFeature());
|
||||
storeConfig->warnUnknownSettings();
|
||||
|
||||
auto store = storeConfig->openStore();
|
||||
store->init();
|
||||
|
||||
return store;
|
||||
return storeConfig;
|
||||
}
|
||||
|
||||
std::list<ref<Store>> getDefaultSubstituters()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue