Open Rubikoid opened 1 month ago
Hey, this is still an open to-do, https://github.com/Janik-Haag/NixOS-DNS/blob/main/modules/nixos.nix#L91 I don't really know how to handle the merge operation for soa records, and since they aren't host specific, I think it's reasonable to enforce them being in extraConfig only. Do you have some reason you'd want to avoid extraConfig, or some suggestion how merging here should be handled?
Btw a bit tangential but something I should document at some point is that you can use self.lastModified
(with flakes) or (builtins.fetchGit ./.).lastModified
(without flakes) and you get the unix-millis timestamp of your last git commit in the repo which is perfect as SOA serial.
Hey, this is still an open to-do,
Oh, sorry, I missed this part in sources ;(
Do you have some reason you'd want to avoid extraConfig
Not really. In my case I put all the DNS settings into one machine's config (I know this is not how library should be used, but this way was a little more convenient in my setup), so it was quite logical to keep all the records in one place and do not split between two attrsets.
some suggestion how merging here should be handled
Maybe allow specifying only one soa record per global dns config, and if the merging needed (i.e. user created more than one record) - throw error? But I'm not sure this is a good path.
is that you can use
self.lastModified
(with flakes)
This is a great idea, thanks!
Simple setup with defining SOA using
subDomains
(instead ofextraConfig
as in example) don't builds zone files:Wherein it's impossible to pass list in
soa.data
, because it is null or submodule.Full example to reproduce:
nix build ".#dns.zoneFiles" -v --show-trace