ITADN

`subDomains` working as not expected from docs

#16OpenRubikoid 创建于 2024-08-02
R
Rubikoidcommented
According to `subDomains -> matches` table at [docs](https://janik-haag.github.io/NixOS-DNS/usage.html#nixos-module), I thought the next configuration ```nix ( let rootZone = "example.org"; in { networking.domains = { enable = true; defaultTTL = 86400; # 24h baseDomains."nodes.${rootZone}" = { }; baseDomains."${rootZone}" = { }; subDomains."xxx.nodes.${rootZone}".a.data = [ "1.1.1.1" ]; subDomains."yyy.${rootZone}".cname.data = [ "xxx.nodes.${rootZone}" ]; }; } ) ``` will evaluate to something like that ```nix { "nodes.example.org" = { "xxx.nodes.example.org" = { a = { data = [ "1.1.1.1" ]; ttl = 86400; }; }; }; "example.org" = { "yyy.example.org" = { cname = { data = [ "xxx.nodes.example.org" ]; ttl = 86400; }; }; }; } ``` But in real on the latest master this evaluates to: ```nix { "example.org" = { "xxx.nodes.example.org" = { a = { data = [ "1.1.1.1" ]; ttl = 86400; }; }; "yyy.example.org" = { cname = { data = [ "xxx.nodes.example.org" ]; ttl = 86400; }; }; }; } ``` So, the `baseDomains."nodes.${rootZone}" = { };` line makes no changes whenever it exists or not. As how Im traced, this happens due to [`reducedBaseDomains`](https://github.com/Janik-Haag/NixOS-DNS/blob/c4f734d771038db15700a61a8703d0da5f993b3a/utils/domains.nix#L231). Is this intended? Also there is an error in code block before table, `networking.domains.baseDomains` should be replaced with `networking.domains.subDomains`, otherwise this sample makes no sense.
1 条评论