infra/config/services/attic.nix

38 lines
878 B
Nix
Raw Normal View History

2024-09-18 16:10:20 +02:00
{ config, ... }:
{
2023-07-05 21:41:15 +02:00
services.atticd = {
enable = true;
credentialsFile = config.age.secrets."services/attic/atticd.env".path;
settings = {
listen = "127.0.0.1:8080";
chunking = {
nar-size-threshold = 64 * 1024; # 64 KiB
min-size = 16 * 1024; # 16 KiB
avg-size = 64 * 1024; # 64 KiB
max-size = 256 * 1024; # 256 KiB
};
storage = {
bucket = "attic";
endpoint = "https://s3.winston.sh";
region = "eu-central-1";
type = "s3";
};
2023-07-05 21:41:15 +02:00
};
};
services.nginx.virtualHosts."attic.winston.sh" = {
forceSSL = true;
enableACME = false;
useACMEHost = "winston.sh";
locations."/" = {
extraConfig =
# nginx
''
client_max_body_size 512M;
'';
2023-07-05 21:41:15 +02:00
proxyPass = "http://${config.services.atticd.settings.listen}";
};
};
}