From 4dd1c57d05e111ea7b3ec03795fd39ef551549f9 Mon Sep 17 00:00:00 2001 From: niten Date: Fri, 6 Oct 2023 10:05:40 -0700 Subject: [PATCH] Nest in options... --- zone-definition.nix | 180 ++++++++++++++++++++++---------------------- 1 file changed, 91 insertions(+), 89 deletions(-) diff --git a/zone-definition.nix b/zone-definition.nix index 9523a73..bf7cbef 100644 --- a/zone-definition.nix +++ b/zone-definition.nix @@ -74,112 +74,114 @@ let zoneOpts = { options = with types; { - hosts = attrsOf (submodule networkHostOpts); - description = "Hosts on the local network, with relevant settings."; - default = { }; - }; + hosts = mkOption { + attrsOf (submodule networkHostOpts); + description = "Hosts on the local network, with relevant settings."; + default = { }; + }; - nameservers = mkOption { - type = listOf str; - description = "List of zone nameservers."; - example = [ "ns1.domain.com." "10.0.0.1" ]; - default = [ ]; - }; + nameservers = mkOption { + type = listOf str; + description = "List of zone nameservers."; + example = [ "ns1.domain.com." "10.0.0.1" ]; + default = [ ]; + }; - srv-records = mkOption { - type = attrsOf (attrsOf (listOf (submodule srvRecordEntry))); - description = "SRV records for this zone."; - example = { - tcp = { - xmpp = [{ - host = "my-host.com"; - port = 55; - }]; + srv-records = mkOption { + type = attrsOf (attrsOf (listOf (submodule srvRecordEntry))); + description = "SRV records for this zone."; + example = { + tcp = { + xmpp = [{ + host = "my-host.com"; + port = 55; + }]; + }; }; }; - }; - meric-records = mkOption { - type = attrsOf (listOf (submodule srvRecordEntry)); - description = "Map of metric types to a list of SRV host records."; - example = { - node = [{ - host = "my-host.my-domain.com"; - port = 443; - }]; - postfix = [{ - host = "my-mailserver.my-domain.com"; - port = 443; - }]; + meric-records = mkOption { + type = attrsOf (listOf (submodule srvRecordEntry)); + description = "Map of metric types to a list of SRV host records."; + example = { + node = [{ + host = "my-host.my-domain.com"; + port = 443; + }]; + postfix = [{ + host = "my-mailserver.my-domain.com"; + port = 443; + }]; + }; + default = { }; }; - default = { }; - }; - aliases = mkOption { - type = attrsOf str; - description = - "A mapping of host-alias -> hostname to add to the doamin record."; - default = { }; - example = { - my-alias = "some-host"; - external-alias = "host-outside.domain.com."; + aliases = mkOption { + type = attrsOf str; + description = + "A mapping of host-alias -> hostname to add to the doamin record."; + default = { }; + example = { + my-alias = "some-host"; + external-alias = "host-outside.domain.com."; + }; }; - }; - verbatim-dns-records = mkOption { - type = listOf str; - description = "Records to be inserted verbatim into the DNS zone."; - default = [ ]; - example = [ "some-host IN CNAME target-host" ]; - }; + verbatim-dns-records = mkOption { + type = listOf str; + description = "Records to be inserted verbatim into the DNS zone."; + default = [ ]; + example = [ "some-host IN CNAME target-host" ]; + }; - dmark-report-address = mkOption { - type = nullOr str; - description = "Email address to recieve DMARC reports, if any."; - example = "admin-user@domain.com"; - default = null; - }; + dmark-report-address = mkOption { + type = nullOr str; + description = "Email address to recieve DMARC reports, if any."; + example = "admin-user@domain.com"; + default = null; + }; - default-host = mkOption { - type = nullOr (submodule networkHostOpts); - description = - "Network properties of the default host for this domain, if any."; - default = null; - }; + default-host = mkOption { + type = nullOr (submodule networkHostOpts); + description = + "Network properties of the default host for this domain, if any."; + default = null; + }; - mx = mkOption { - type = listOf str; - description = "A list of mail servers which serve this domain."; - default = [ ]; - }; + mx = mkOption { + type = listOf str; + description = "A list of mail servers which serve this domain."; + default = [ ]; + }; - gssapi-realm = mkOption { - type = nullOr str; - description = "Kerberos GSSAPI realm of the zone."; - default = null; - }; + gssapi-realm = mkOption { + type = nullOr str; + description = "Kerberos GSSAPI realm of the zone."; + default = null; + }; - default-ttl = mkOption { - type = str; - description = "Default time-to-live for this zone."; - default = "3h"; - }; + default-ttl = mkOption { + type = str; + description = "Default time-to-live for this zone."; + default = "3h"; + }; - host-record-ttl = mkOption { - type = str; - description = "Default time-to-live for hosts in this zone"; - default = "1h"; - }; + host-record-ttl = mkOption { + type = str; + description = "Default time-to-live for hosts in this zone"; + default = "1h"; + }; - description = mkOption { - type = str; - description = "Description of this zone."; - }; + description = mkOption { + type = str; + description = "Description of this zone."; + }; - subdomains = mkOption { - type = attrsOf (submodule zoneOpts); - description = "Subdomains of the current zone."; - default = { }; + subdomains = mkOption { + type = attrsOf (submodule zoneOpts); + description = "Subdomains of the current zone."; + default = { }; + }; }; };