bring back attic. this time with garage backend
This commit is contained in:
parent
f4f0691647
commit
f4c7243b69
10 changed files with 107 additions and 183 deletions
47
modules/attic.nix
Normal file
47
modules/attic.nix
Normal 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
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -8,5 +8,6 @@
|
|||
./containerization.nix
|
||||
./vaultwarden.nix
|
||||
./searx.nix
|
||||
./attic.nix
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue