alloy: Make domain optional

This commit is contained in:
SebastianStork 2026-03-05 22:40:26 +01:00
parent b0c5efe028
commit 3836b76427
Signed by: SebastianStork
SSH key fingerprint: SHA256:tRrGdjYOwgHxpSc/wTOZQZEjxcb15P0tyXRsbAfd+2Q

View file

@ -11,8 +11,8 @@ in
options.custom.services.alloy = { options.custom.services.alloy = {
enable = lib.mkEnableOption ""; enable = lib.mkEnableOption "";
domain = lib.mkOption { domain = lib.mkOption {
type = lib.types.nonEmptyStr; type = lib.types.nullOr lib.types.nonEmptyStr;
default = ""; default = null;
}; };
port = lib.mkOption { port = lib.mkOption {
type = lib.types.port; type = lib.types.port;
@ -128,6 +128,6 @@ in
}; };
}; };
custom.services.caddy.virtualHosts.${cfg.domain}.port = cfg.port; custom.services.caddy.virtualHosts.${cfg.domain}.port = lib.mkIf (cfg.domain != null) cfg.port;
}; };
} }