Use harmonia instead of attic for binary cache
All checks were successful
CI / Check, build and cache Nix flake (push) Successful in 2h1m7s

This commit is contained in:
2024-07-20 16:46:10 +01:00
parent 1ea172e690
commit 69216c6b4c
11 changed files with 113 additions and 31 deletions

View File

@@ -239,6 +239,8 @@ in
];
recommendedTlsSettings = true;
recommendedBrotliSettings = true;
recommendedZstdSettings = true;
clientMaxBodySize = "0";
serverTokens = true;
resolver = {

View File

@@ -407,10 +407,13 @@ in
ignore_invalid_headers off;
'';
nixCacheableRegex = ''^\/(\S+\.narinfo|nar\/\S+\.nar\.\S+)$'';
nixCacheableRegex = ''^\/(\S+\.narinfo|nar\/\S+\.nar.*|serve\/.+)$'';
nixCacheHeaders = ''
add_header Cache-Control $nix_cache_control;
add_header Expires $nix_expires;
brotli on;
brotli_types application/x-nix-archive;
'';
in
{
@@ -452,9 +455,11 @@ in
"nix-cache.${pubDomain}" = {
locations = {
"/".proxyPass = "http://${host}:8069";
"/" = {
proxyPass = "http://${host}:5000";
};
"~ ${nixCacheableRegex}" = {
proxyPass = "http://${host}:8069";
proxyPass = "http://${host}:5000";
extraConfig = nixCacheHeaders;
};
};