Only use cache.nixos.org when the store is /nix/store

This is consistent with the behaviour of the old
download-from-binary-cache substituter.
This commit is contained in:
Eelco Dolstra 2017-03-21 17:59:18 +01:00
parent ecbc3fedd3
commit e1e49c58e1
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -778,7 +778,11 @@ std::list<ref<Store>> getDefaultSubstituters()
state->stores.push_back(openStore(uri));
};
for (auto uri : settings.get("substituters", settings.get("binary-caches", Strings{"https://cache.nixos.org/"})))
Strings defaultSubstituters;
if (settings.nixStore == "/nix/store")
defaultSubstituters.push_back("https://cache.nixos.org/");
for (auto uri : settings.get("substituters", settings.get("binary-caches", defaultSubstituters)))
addStore(uri);
for (auto uri : settings.get("extra-binary-caches", Strings()))