2 ms·
While this will aid usability, I think it's a symptom of a harder problem: the composition of configuration for different services. My approach for DNS is to u
by ryangibb 4y ago
While this will aid usability, I think it's a symptom of a harder problem: the composition of configuration for different services.
My approach for DNS is to use a NixOS module that describes the configuration of a zonefile [0]. Then, for example, to add an MX record for the root pointing to the `mail` subdomain, one can do:
dns.records = [
{
name = "@";
type = "MX";
data = "10 mail";
}
];
This configuration is used to create a zonefile with a Nix derivation [1] that can be provided to a DNS service [2].
This has the advantage that comments and any other metadata to be included can be added here, the configuration can be version controlled and merged/reverted as appropriate, and that the DNS records for services can configured right alongside them.
It has it's limitations though. There may be implicit dependencies in the runtime of different services. It's hard to test because of this.
[0] https://github.com/RyanGibb/eilean-nix/blob/0b4213b0/modules/dns/default.nix https://github.com/RyanGibb/eilean-nix/blob/0b4213b0/modules...
[1] https://github.com/RyanGibb/eilean-nix/blob/0b4213b0/modules/dns/zonefile.nix https://github.com/RyanGibb/eilean-nix/blob/0b4213b0/modules...
[2] https://github.com/RyanGibb/eilean-nix/blob/0b4213b0/modules/dns/bind.nix https://github.com/RyanGibb/eilean-nix/blob/0b4213b0/modules...