about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-03-21T16·59+0100
committerEelco Dolstra <edolstra@gmail.com>2017-03-21T16·59+0100
commite1e49c58e1218fb6240dbd9780a8c67462e95d2d (patch)
tree8b8709c2d2a5e4a4826ea3b1c74de1cdb80ac530 /src/libstore
parentecbc3fedd3d5bdc5a0e1a0a51b29062f2874ac8b (diff)
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.
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/store-api.cc6
1 files changed, 5 insertions, 1 deletions
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<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()))