summaryrefslogtreecommitdiff
path: root/sys/ns/rr.nix
diff options
context:
space:
mode:
Diffstat (limited to 'sys/ns/rr.nix')
-rw-r--r--sys/ns/rr.nix20
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;