Better octodns file structure
This commit is contained in:
parent
190dde841e
commit
35bc79265c
33 changed files with 219 additions and 381 deletions
dns/implementation
17
dns/implementation/nixos-module-assertions.nix
Normal file
17
dns/implementation/nixos-module-assertions.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
# This must only be loaded on actual Nixos, otherwise `assertions`
|
||||
# won't be defined when running `evaluateModules`.
|
||||
{ config, ... }:
|
||||
let cfg = config.satellite.dns;
|
||||
in
|
||||
{
|
||||
config.assertions =
|
||||
let assertProperToUsage = config:
|
||||
{
|
||||
assertion = (config.to == null) || (config.type == "CNAME");
|
||||
message = ''
|
||||
The option `satellite.dns.records[*].to` can only be used with `CNAME` records.
|
||||
This was not the case for ${config.type} record at ${config.at}.${config.zone}.
|
||||
'';
|
||||
};
|
||||
in builtins.map assertProperToUsage cfg.records;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue