feat(LOTS): this needs work

This commit is contained in:
2025-09-07 20:25:59 +02:00
parent b8cd4cd16c
commit 764b5bb944
7 changed files with 63 additions and 7 deletions

View File

@@ -6,7 +6,16 @@
let
inherit (lib) mkIf mkEnableOption;
cfg = config.server.caddy;
in
getCloudflareCredentials =
hostname:
if hostname == "ziggy" then
config.age.secrets.cloudflareDnsCredentialsZiggy.path
else if hostname == "sobotka" then
config.age.secrets.cloudflareDnsCredentials.path
else
throw "Unknown hostname: ${hostname}";
in
{
options = {
server.caddy.enable = mkEnableOption "Enables caddy";
@@ -34,7 +43,7 @@ in
dnsResolver = "1.1.1.1:53";
dnsPropagationCheck = true;
group = config.services.caddy.group;
environmentFile = config.age.secrets.cloudflareDnsCredentials.path;
environmentFile = getCloudflareCredentials config.networking.hostName;
};
};