summaryrefslogtreecommitdiff
path: root/sys/ns
diff options
context:
space:
mode:
Diffstat (limited to 'sys/ns')
-rw-r--r--sys/ns/default.nix1
-rw-r--r--sys/ns/ns.nix32
2 files changed, 33 insertions, 0 deletions
diff --git a/sys/ns/default.nix b/sys/ns/default.nix
index 8c02d1d..47d97d7 100644
--- a/sys/ns/default.nix
+++ b/sys/ns/default.nix
@@ -1,5 +1,6 @@
{
imports = [
+ ./ns.nix
./nsd.nix
./rr.nix
./zones
diff --git a/sys/ns/ns.nix b/sys/ns/ns.nix
new file mode 100644
index 0000000..30a98d4
--- /dev/null
+++ b/sys/ns/ns.nix
@@ -0,0 +1,32 @@
+{ lib, ... }:
+with lib; {
+ options.local.ns.zones = mkOption {
+ type = with lib.types; attrsOf (submodule ({ config, name, ... }:
+ let
+ cfg = config.localNS;
+ in
+ {
+ options.localNS = {
+ enable = mkEnableOption "local NS settings";
+
+ primary = mkOption {
+ type = str;
+ };
+ };
+
+ config = mkIf cfg.enable {
+ ns = [
+ { name = "@"; host = cfg.primary; }
+ ];
+
+ a = [
+ { name = cfg.primary; ipv4 = "37.205.12.147"; }
+ ];
+
+ aaaa = [
+ { name = cfg.primary; ipv6 = "2a03:3b40:fe:3ec::1"; }
+ ];
+ };
+ }));
+ };
+}