Skip to content

Commit 9f31187

Browse files
Fix type of SRV target (#1)
* Fix type of SRV target * SRV target is not nullable * Add SRV record to tests --------- Co-authored-by: Janik <80165193+Janik-Haag@users.noreply.github.com>
1 parent c00f1b8 commit 9f31187

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

modules/records.nix

+2-2
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,8 @@ lib.mapAttrs
299299
description = lib.mdDoc ''
300300
The canonical hostname of the machine providing the service.
301301
'';
302-
example = "ftp://example.com/public";
303-
type = lib.types.int;
302+
example = "example.com";
303+
type = lib.types.str; # change str to lib.types.domain once it exists;
304304
apply = x: "${x}.";
305305
};
306306
};

utils/tests/debug.nix

+3
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ in
4646
"example.org" = {
4747
cname = { data = [ "www.example.com" ]; ttl = 60; };
4848
};
49+
"_xmpp._tcp.example.org" = {
50+
srv = { data = [{ port = 5223; priority = 10; weight = 5; target = "host1.example.com."; }]; ttl = 60; };
51+
};
4952
};
5053
};
5154
};

utils/tests/domains.nix

+3
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@
128128
"example.org" = {
129129
cname = { data = [ "www.example.com" ]; ttl = 60; };
130130
};
131+
"_xmpp._tcp.example.org" = {
132+
srv = { data = [{ port = 5223; priority = 10; weight = 5; target = "host1.example.com."; }]; ttl = 60; };
133+
};
131134
};
132135
};
133136
};

utils/tests/resources/dnsConfig.nix

+8
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ in
1919
"" = {
2020
cname.data = "www.example.com";
2121
};
22+
"_xmpp._tcp" = {
23+
srv.data = {
24+
priority = 10;
25+
weight = 5;
26+
port = 5223;
27+
target = "host1.example.com";
28+
};
29+
};
2230
};
2331
};
2432
};

0 commit comments

Comments
 (0)