diff --git a/config/net/cluster.nix b/config/net/cluster.nix index a2b49d8..a637b9b 100644 --- a/config/net/cluster.nix +++ b/config/net/cluster.nix @@ -7,8 +7,15 @@ in ipv6Router = "cls-gw"; domainName = "cluster.zentralwerk.org"; extraRecords = map (host: { - data = "1 1 6789 ${host}"; - name = "_ceph-mon._tcp"; + data = { + service = "ceph-mon"; + proto = "tcp"; + priority = 1; + weight = 1; + port = 6789; + target = host; + }; + name = "@"; type = "SRV"; }) cephMonServers ++ diff --git a/nix/lib/config/options.nix b/nix/lib/config/options.nix index de776c2..63131d7 100644 --- a/nix/lib/config/options.nix +++ b/nix/lib/config/options.nix @@ -178,7 +178,7 @@ let type = enum [ "A" "AAAA" "MX" "SRV" "CNAME" "TXT" ]; }; data = mkOption { - type = str; + type = oneOf [ str (attrsOf (oneOf [ int str ])) ]; }; }; }); diff --git a/nix/nixos-module/container/dns.nix b/nix/nixos-module/container/dns.nix index 329392e..262d0db 100644 --- a/nix/nixos-module/container/dns.nix +++ b/nix/nixos-module/container/dns.nix @@ -35,7 +35,7 @@ in type = types.enum [ "A" "AAAA" "MX" "SRV" "CNAME" "TXT" "PTR" ]; }; data = mkOption { - type = types.str; + type = types.oneOf [ types.str (types.attrsOf (types.oneOf [ types.int types.str ]))]; }; };