builder: add attic binary cache
All checks were successful
Update Nix Flake / update-flake (push) Successful in 1m19s

This commit is contained in:
Julian Mutter 2025-03-22 12:55:16 +01:00
parent 27c36bb7f5
commit d964a181ad
2 changed files with 44 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -211,6 +211,11 @@
locations."/".proxyPass =
"http://${config.services.nix-serve.bindAddress}:${toString config.services.nix-serve.port}";
};
clientMaxBodySize = "2G";
virtualHosts."cache.julian-mutter.de" = {
locations."/".proxyPass = "http://127.0.0.1:8080";
};
};
# =========== Gitea actions ==========
@ -242,6 +247,42 @@
secretKeyFile = "/var/cache-priv-key.pem";
};
# =========== Binary Cache with attic ==========
sops.secrets."attic_token".sopsFile = ../../../secrets/secrets-builder.yaml;
services.atticd = {
enable = true;
environmentFile = config.sops.secrets."attic_token".path;
settings = {
listen = "[::]:8080";
jwt = { };
# Data chunking
#
# Warning: If you change any of the values here, it will be
# difficult to reuse existing chunks for newly-uploaded NARs
# since the cutpoints will be different. As a result, the
# deduplication ratio will suffer for a while after the change.
chunking = {
# The minimum NAR size to trigger chunking
#
# If 0, chunking is disabled entirely for newly-uploaded NARs.
# If 1, all NARs are chunked.
nar-size-threshold = 64 * 1024; # 64 KiB
# The preferred minimum size of a chunk, in bytes
min-size = 16 * 1024; # 16 KiB
# The preferred average size of a chunk, in bytes
avg-size = 64 * 1024; # 64 KiB
# The preferred maximum size of a chunk, in bytes
max-size = 256 * 1024; # 256 KiB
};
};
};
# ======================== DO NOT CHANGE THIS ========================
system.stateVersion = "23.11";
# ======================== DO NOT CHANGE THIS ========================