mirror of
https://seed.radicle.dev/rad:z254T5p17bdFPmzfDojsdjo4HjpoZ.git
synced 2026-11-21 18:40:42 +08:00
55 lines
1.2 KiB
Nix
55 lines
1.2 KiB
Nix
{config, ...}: let
|
|
domain = "attic.radicle.dev";
|
|
port = 54862;
|
|
secret = "atticd.env";
|
|
in {
|
|
sops.secrets.${secret} = {
|
|
sopsFile = ./sops/atticd.env;
|
|
format = "dotenv";
|
|
};
|
|
|
|
services = {
|
|
atticd = {
|
|
enable = true;
|
|
environmentFile = config.sops.secrets.${secret}.path;
|
|
settings = {
|
|
listen = "127.0.0.1:${builtins.toString port}";
|
|
|
|
storage = {
|
|
bucket = "radicle-attic";
|
|
type = "s3";
|
|
region = "eu-central";
|
|
endpoint = "https://hel1.your-objectstorage.com";
|
|
};
|
|
|
|
garbage-collection.interval = "48 hours";
|
|
|
|
api-endpoint = "https://${domain}/";
|
|
};
|
|
};
|
|
nginx.virtualHosts.${domain} = {
|
|
enableACME = true;
|
|
forceSSL = true;
|
|
quic = true;
|
|
serverName = domain;
|
|
|
|
extraConfig = ''
|
|
add_header Alt-Svc 'h3=":443"' always;
|
|
'';
|
|
|
|
locations."/" = {
|
|
proxyPass = "http://127.0.0.1:${builtins.toString port}";
|
|
extraConfig = ''
|
|
client_max_body_size 512m;
|
|
'';
|
|
};
|
|
};
|
|
nginx.virtualHosts."attic.radicle.xyz" = {
|
|
enableACME = true;
|
|
forceSSL = true;
|
|
globalRedirect = domain;
|
|
redirectCode = 302;
|
|
};
|
|
};
|
|
}
|