From 6cb7bc22e8419a7a16b8a4485627b162c68905cd Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 16 Nov 2026 18:10:05 +0000 Subject: binary-cache: add client Use ne's and zu's binary cache. With fallback, Nix disables a cache it can't reach for 60 seconds and builds instead, so an offline cache doesn't fail the build. connect-timeout lowers the wait per attempt from the default 15 seconds to 5. Nix retries failed downloads from every cache up to 5 times by default. For an unreachable cache that means waiting about 30 seconds per URL in each Nix command before Nix disables it. With one attempt, it is connect-timeout, 5 seconds. This also applies to cache.nixos.org. --- configs/binary-cache/client.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 configs/binary-cache/client.nix diff --git a/configs/binary-cache/client.nix b/configs/binary-cache/client.nix new file mode 100644 index 0000000..66b17c6 --- /dev/null +++ b/configs/binary-cache/client.nix @@ -0,0 +1,15 @@ +{ config, ... }: { + nix.settings = { + fallback = true; + connect-timeout = 5; + download-attempts = 1; + substituters = [ + "http://cache.ne.r?priority=20" + "http://cache.zu.r?priority=20" + ]; + trusted-public-keys = [ + config.krebs.hosts.ne.binary-cache.pubkey + config.krebs.hosts.zu.binary-cache.pubkey + ]; + }; +} -- cgit v1.3.1