2025-10-01 19:51:55 -05:00
|
|
|
{
|
|
|
|
|
config,
|
|
|
|
|
flake,
|
|
|
|
|
...
|
|
|
|
|
}:
|
|
|
|
|
let
|
|
|
|
|
inherit (flake.config.people) user0;
|
|
|
|
|
inherit (flake.config.people.users.${user0}) email;
|
|
|
|
|
inherit (flake.config.services) instances;
|
|
|
|
|
domain0 = instances.web.domains.url0;
|
|
|
|
|
domain1 = instances.web.domains.url1;
|
|
|
|
|
domain4 = flake.inputs.linkpage.secrets.domains.projectsite;
|
2025-10-25 05:16:26 -05:00
|
|
|
service = instances.acme;
|
2025-10-01 19:51:55 -05:00
|
|
|
dns0 = instances.web.dns.provider0;
|
|
|
|
|
dns1 = instances.web.dns.provider1;
|
|
|
|
|
dns0Path = "dns/${dns0}";
|
|
|
|
|
dns1Path = "dns/${dns1}";
|
|
|
|
|
in
|
|
|
|
|
{
|
|
|
|
|
security.acme = {
|
|
|
|
|
acceptTerms = true;
|
|
|
|
|
defaults = {
|
|
|
|
|
email = email.address0;
|
|
|
|
|
server = "https://acme-v02.api.letsencrypt.org/directory";
|
|
|
|
|
};
|
2025-11-04 03:30:52 -06:00
|
|
|
certs =
|
|
|
|
|
let
|
2025-11-08 01:54:19 -06:00
|
|
|
dnsConfig = provider: dns: {
|
2025-11-04 03:30:52 -06:00
|
|
|
dnsProvider = dns;
|
|
|
|
|
environmentFile = config.sops.secrets.${provider}.path;
|
|
|
|
|
};
|
|
|
|
|
in
|
|
|
|
|
{
|
2025-11-06 04:08:29 -06:00
|
|
|
# "${instances.audiobookshelf.domains.url0}" = dnsConfig dns0Path dns0;
|
|
|
|
|
# "${instances.glance.domains.url0}" = dnsConfig dns0Path dns0;
|
|
|
|
|
# "${instances.jellyfin.domains.url0}" = dnsConfig dns0Path dns0;
|
|
|
|
|
# "${instances.ollama.domains.url0}" = dnsConfig dns0Path dns0;
|
|
|
|
|
# "${instances.searx.domains.url0}" = dnsConfig dns0Path dns0;
|
|
|
|
|
# "${instances.syncthing.domains.url0}" = dnsConfig dns0Path dns0;
|
2025-11-08 02:25:01 -06:00
|
|
|
# "${instances.vaultwarden.domains.url0}" = dnsConfig dns0Path dns0; # Moved to vaultwarden service module
|
2025-11-06 04:08:29 -06:00
|
|
|
# "${instances.prompter.domains.url0}" = dnsConfig dns0Path dns0;
|
|
|
|
|
# "${instances.comfyui.domains.url0}" = dnsConfig dns0Path dns0;
|
|
|
|
|
# "${instances.firefly-iii.domains.url0}" = dnsConfig dns0Path dns0;
|
|
|
|
|
# "${instances.opencloud.domains.url0}" = dnsConfig dns0Path dns0;
|
2025-11-04 03:30:52 -06:00
|
|
|
"${instances.forgejo.domains.url0}" = dnsConfig dns0Path dns0;
|
2025-11-06 04:08:29 -06:00
|
|
|
# "${instances.mastodon.domains.url0}" = dnsConfig dns0Path dns0;
|
|
|
|
|
# "${domain0}" = dnsConfig dns0Path dns0;
|
|
|
|
|
# "${domain1}" = dnsConfig dns0Path dns0;
|
|
|
|
|
# "${domain4}" = dnsConfig dns1Path dns1;
|
2025-11-04 03:30:52 -06:00
|
|
|
};
|
2025-10-01 19:51:55 -05:00
|
|
|
};
|
2025-11-04 03:30:52 -06:00
|
|
|
|
2025-10-01 19:51:55 -05:00
|
|
|
sops =
|
|
|
|
|
let
|
|
|
|
|
dnsList = [
|
|
|
|
|
dns0
|
|
|
|
|
dns1
|
|
|
|
|
];
|
|
|
|
|
secretList = [
|
|
|
|
|
"pass"
|
|
|
|
|
];
|
|
|
|
|
sopsPath = secret: dns: {
|
|
|
|
|
path = "/var/lib/secrets/${instances.acme.name}/${dns}-${secret}";
|
|
|
|
|
owner = "root";
|
|
|
|
|
mode = "600";
|
|
|
|
|
};
|
|
|
|
|
in
|
|
|
|
|
{
|
|
|
|
|
secrets = builtins.listToAttrs (
|
|
|
|
|
builtins.concatLists (
|
|
|
|
|
map (
|
|
|
|
|
dns:
|
|
|
|
|
map (secret: {
|
|
|
|
|
name = "dns/${dns}";
|
|
|
|
|
value = sopsPath secret dns;
|
|
|
|
|
}) secretList
|
|
|
|
|
) dnsList
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
};
|
2025-10-25 05:16:26 -05:00
|
|
|
|
|
|
|
|
systemd = {
|
|
|
|
|
tmpfiles.rules = [
|
|
|
|
|
"Z ${service.sops.path0} 755 ${service.name} ${service.name} -"
|
|
|
|
|
];
|
|
|
|
|
};
|
2025-10-01 19:51:55 -05:00
|
|
|
}
|