From e1e49c58e1218fb6240dbd9780a8c67462e95d2d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 21 Mar 2017 17:59:18 +0100 Subject: 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. --- src/libstore/store-api.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/libstore/store-api.cc') diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index 8c3422e0b43a..441166d04d8f 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -778,7 +778,11 @@ std::list> 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())) -- cgit 1.4.1