diff options
| author | Alejandro Soto <alejandro@34project.org> | 2024-08-10 12:04:55 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2024-08-10 12:05:12 -0600 |
| commit | 95982afebf37e838bd0ab871732966aca98c1744 (patch) | |
| tree | 8a8b56507e1592419150a59706c04668f280c308 /sys/ns/rr.nix | |
| parent | d9c39be2f5cf057e2064d4990315314f4192b0a1 (diff) | |
sys/ns/34project.org: switch to local nameservers
Diffstat (limited to 'sys/ns/rr.nix')
| -rw-r--r-- | sys/ns/rr.nix | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/sys/ns/rr.nix b/sys/ns/rr.nix index 8f9318d..a007c4a 100644 --- a/sys/ns/rr.nix +++ b/sys/ns/rr.nix @@ -41,7 +41,7 @@ in type = with lib.types; attrsOf (submodule ({ config, name, ... }: let - nameOption = mkOption { + nameOption = extra: mkOption (extra // { type = domainRefType; apply = value: @@ -50,13 +50,13 @@ in else if ! hasSuffix "." value then "${value}.${name}." else value; - }; + }); rrType = options: mkOption { default = [ ]; type = listOf (submodule { options = options // { - name = nameOption; + name = nameOption { }; ttl = mkOption { type = int; @@ -103,7 +103,7 @@ in type = listOf (submodule { options = { - name = nameOption; + name = nameOption { }; ttl = mkOption { type = int; @@ -132,10 +132,12 @@ in default = config.defaultTTL; }; - primary = nameOption; + primary = nameOption { default = "ns1"; }; hostmaster = mkOption { type = emailType; + default = "hostmaster"; + apply = address: let split = splitString "@" address; @@ -187,11 +189,11 @@ in }; cname = rrType { - target = nameOption; + target = nameOption { }; }; mx = rrType { - host = nameOption; + host = nameOption { }; priority = mkOption { type = int; @@ -199,11 +201,11 @@ in }; ns = rrType { - host = nameOption; + host = nameOption { }; }; srv = rrType { - host = nameOption; + host = nameOption { }; port = mkOption { type = port; |
