From 4bb38591e591e3ef59f7881575ca1f28015a8c47 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 21 Mar 2017 15:06:46 +0100 Subject: [PATCH] Restore cache.nixos.org as the default substituter Fixes #1283. --- perl/lib/Nix/Config.pm.in | 10 ---------- src/libstore/crypto.cc | 4 +++- src/libstore/store-api.cc | 5 +---- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/perl/lib/Nix/Config.pm.in b/perl/lib/Nix/Config.pm.in index 3575d99cb..3613926f5 100644 --- a/perl/lib/Nix/Config.pm.in +++ b/perl/lib/Nix/Config.pm.in @@ -19,10 +19,6 @@ $useBindings = "@perlbindings@" eq "yes"; %config = (); -%binaryCachePublicKeys = (); - -$defaultPublicKeys = "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="; - sub readConfig { if (defined $ENV{'_NIX_OPTIONS'}) { foreach my $s (split '\n', $ENV{'_NIX_OPTIONS'}) { @@ -40,12 +36,6 @@ sub readConfig { } close CONFIG; } - - foreach my $s (split(/ /, $config{"binary-cache-public-keys"} // $defaultPublicKeys)) { - my ($keyName, $publicKey) = split ":", $s; - next unless defined $keyName && defined $publicKey; - $binaryCachePublicKeys{$keyName} = decode_base64($publicKey); - } } return 1; diff --git a/src/libstore/crypto.cc b/src/libstore/crypto.cc index 747483afb..0fc86a1fe 100644 --- a/src/libstore/crypto.cc +++ b/src/libstore/crypto.cc @@ -105,7 +105,9 @@ PublicKeys getDefaultPublicKeys() // FIXME: filter duplicates - for (auto s : settings.get("binary-cache-public-keys", Strings())) { + for (auto s : settings.get("binary-cache-public-keys", + Strings{"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="})) + { PublicKey key(s); publicKeys.emplace(key.name, key); } diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index b1bf961e1..8c3422e0b 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -778,10 +778,7 @@ std::list> getDefaultSubstituters() state->stores.push_back(openStore(uri)); }; - for (auto uri : settings.get("substituters", Strings())) - addStore(uri); - - for (auto uri : settings.get("binary-caches", Strings())) + for (auto uri : settings.get("substituters", settings.get("binary-caches", Strings{"https://cache.nixos.org/"}))) addStore(uri); for (auto uri : settings.get("extra-binary-caches", Strings()))