From b8e011f7927e63383b3f22ae32eb53fc86449315 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 7 Jan 2022 03:47:18 +0300 Subject: chore(cache.tvl.su): Raise cache priority to 50 The priority of binary caches is decided by the remotes in Nix (???), and by default nix-serve (which is *very* slow) has a lower priority than cache.nixos.org (which means that it will be preferred over the faster cache for paths that exist on both). To avoid this, override the hardcoded (????) priority by serving the nix-cache-info response directly from nginx instead. Change-Id: I15a2d6618386d16edaf69f1c9257a36bd72132d2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4823 Tested-by: BuildkiteCI Autosubmit: tazjin Reviewed-by: grfn --- ops/modules/www/cache.tvl.su.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ops/modules/www/cache.tvl.su.nix b/ops/modules/www/cache.tvl.su.nix index 633178b5ccec..99bc008cd6a5 100644 --- a/ops/modules/www/cache.tvl.su.nix +++ b/ops/modules/www/cache.tvl.su.nix @@ -17,6 +17,11 @@ alias /run/agenix/nix-cache-pub; } + location = /nix-cache-info { + add_header Content-Type text/plain; + return 200 "StoreDir: /nix/store\nWantMassQuery: 1\nPriority: 50\n"; + } + location / { proxy_pass http://localhost:${toString config.services.nix-serve.port}; } -- cgit 1.4.1