diff --git a/modules/system/networking/overlay.nix b/modules/system/networking/overlay.nix index fd140eb..243e558 100644 --- a/modules/system/networking/overlay.nix +++ b/modules/system/networking/overlay.nix @@ -27,6 +27,10 @@ in type = lib.types.nonEmptyStr; default = ""; }; + fqdn = lib.mkOption { + type = lib.types.nonEmptyStr; + default = "${config.custom.networking.hostName}.${cfg.domain}"; + }; address = lib.mkOption { type = lib.types.nonEmptyStr; diff --git a/modules/system/services/dns.nix b/modules/system/services/dns.nix index 72e7e64..f70e840 100644 --- a/modules/system/services/dns.nix +++ b/modules/system/services/dns.nix @@ -24,9 +24,7 @@ in local-zone = "\"${netCfg.overlay.domain}.\" static"; local-data = let - nodeRecords = - netCfg.nodes - |> lib.map (node: "\"${node.hostName}.${node.overlay.domain}. A ${node.overlay.address}\""); + nodeRecords = netCfg.nodes |> lib.map (node: "\"${node.overlay.fqdn}. A ${node.overlay.address}\""); serviceRecords = allHosts |> lib.attrValues diff --git a/profiles/server.nix b/profiles/server.nix index f4b3dcf..08c9454 100644 --- a/profiles/server.nix +++ b/profiles/server.nix @@ -10,7 +10,7 @@ comin.enable = true; alloy = { enable = true; - domain = "alloy.${config.networking.hostName}.${config.custom.networking.overlay.domain}"; + domain = "alloy.${config.custom.networking.overlay.fqdn}"; }; }; };