summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2024-08-04 16:37:00 -0600
committerAlejandro Soto <alejandro@34project.org>2024-08-04 16:57:20 -0600
commit9bc208cd34b2f015e205ccafba6f368091c1ad1a (patch)
tree7007c98e6b28f322f2e58492557618d1a597a580 /sys
parentc918238932f0d776666e552b8ccf353375703249 (diff)
sys/ns: add locally-managed NS records
Diffstat (limited to '')
-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"; }
+ ];
+ };
+ }));
+ };
+}