Files
nix/modules/services/attic.nix
T
2026-10-21 04:52:51 -05:00

27 lines
934 B
Nix

{
# Private Nix binary cache. Caches are created private; pulling needs a token (netrc).
den.aspects.services.attic = let port = 8090; in {
tunnel = { subdomain = "cache"; inherit port; };
nixos = { config, host, ... }: {
services.atticd = {
enable = true;
# ATTIC_SERVER_TOKEN_RS256_SECRET_BASE64=...
environmentFile = "${config.users.users.${host.owner}.home}/.config/attic/env";
settings = {
listen = "127.0.0.1:${toString port}";
# No api-endpoint: CI uploads stay on localhost (Cloudflare caps bodies at 100MB).
substituter-endpoint = "https://cache.${host.domain}/";
# Big NARs (darling rootfs) dedupe better in chunks.
chunking = {
nar-size-threshold = 64 * 1024;
min-size = 16 * 1024;
avg-size = 64 * 1024;
max-size = 256 * 1024;
};
};
};
};
};
}