From 9bc208cd34b2f015e205ccafba6f368091c1ad1a Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Sun, 4 Aug 2024 16:37:00 -0600 Subject: sys/ns: add locally-managed NS records --- sys/ns/default.nix | 1 + sys/ns/ns.nix | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 sys/ns/ns.nix (limited to 'sys') 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"; } + ]; + }; + })); + }; +} -- cgit v1.2.3