bring back attic. this time with garage backend

This commit is contained in:
cy 2025-03-13 13:25:28 -04:00
parent f4f0691647
commit f4c7243b69
Signed by: cy
SSH key fingerprint: SHA256:o/geVWV4om1QhUSkKvDQeW/eAihwnjyXkqMwrVdbuts
10 changed files with 107 additions and 183 deletions

47
modules/attic.nix Normal file
View file

@ -0,0 +1,47 @@
{
config,
lib,
...
}:
let
cfg = config.my.attic;
in
{
options.my.attic = {
enable = lib.mkEnableOption "attic";
};
config = lib.mkIf cfg.enable {
services.atticd = {
enable = true;
environmentFile = config.sops.secrets."attic/env".path;
settings = {
listen = "[::]:8091";
api-endpoint = "https://cache.cy7.sh/";
allowed-hosts = [ "cache.cy7.sh" ];
require-proof-of-possession = false;
compression = {
type = "zstd";
level = 3;
};
database.url = "postgresql:///atticd?host=/run/postgresql";
storage = {
type = "s3";
region = "us-east-1";
bucket = "attic";
endpoint = "https://s3.cy7.sh";
};
garbage-collection = {
default-retention-period = "1 month";
};
};
};
services.caddy.virtualHosts."cache.cy7.sh".extraConfig = ''
import common
reverse_proxy localhost:8091
'';
};
}