From e36881f6874b67319d1f4c39b433be4099d97cd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Sat, 20 Apr 2024 23:57:34 +0200 Subject: [PATCH] Fix srv records --- config/net/cluster.nix | 11 +++++++++-- nix/lib/config/options.nix | 2 +- nix/nixos-module/container/dns.nix | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) 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 ]))]; }; };