1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 08:31:16 +02:00

Eliminate the substituter mechanism

Substitution is now simply a Store -> Store copy operation, most
typically from BinaryCacheStore to LocalStore.
This commit is contained in:
Eelco Dolstra 2016-04-29 13:57:08 +02:00
parent 21e9d183cc
commit aa3bc3d5dc
16 changed files with 166 additions and 597 deletions

View file

@ -501,4 +501,39 @@ static RegisterStoreImplementation regStore([](const std::string & uri) -> std::
});
std::list<ref<Store>> getDefaultSubstituters()
{
struct State {
bool done = false;
std::list<ref<Store>> stores;
};
static Sync<State> state_;
auto state(state_.lock());
if (state->done) return state->stores;
StringSet done;
auto addStore = [&](const std::string & uri) {
if (done.count(uri)) return;
done.insert(uri);
state->stores.push_back(openStoreAt(uri));
};
for (auto uri : settings.get("substituters", Strings()))
addStore(uri);
for (auto uri : settings.get("binary-caches", Strings()))
addStore(uri);
for (auto uri : settings.get("extra-binary-caches", Strings()))
addStore(uri);
state->done = true;
return state->stores;
}
}