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;
};
};

View File

@@ -6,6 +6,23 @@
let
srv = config.server;
cfg = config.server.podman;
piholeUrl =
if config.networking.hostName == "sobotka" then
"pihole0"
else if config.networking.hostName == "ziggy" then
"pihole1"
else
throw "Unknown hostname";
getPiholeSecret =
hostname:
if hostname == "ziggy" then
[ config.age.secrets.piholeZiggy.path ]
else if hostname == "sobotka" then
[ config.age.secrets.pihole.path ]
else
throw "Unknown hostname: ${hostname}";
in
{
options.server.podman = {
@@ -80,7 +97,7 @@ in
};
url = lib.mkOption {
type = lib.types.str;
default = "pihole.${srv.domain}";
default = "${piholeUrl}.${srv.domain}";
};
homepage.name = lib.mkOption {
type = lib.types.str;
@@ -259,7 +276,7 @@ in
# REV_SERVER = "true";
WEBTHEME = "default-darker";
};
environmentFiles = [ config.age.secrets.pihole.path ];
environmentFiles = getPiholeSecret config.networking.hostName;
ports = [
"53:53/tcp"
"53:53/udp"