From 16dec9b4382596f3979e4a23fc378484b18fad67 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 9 Nov 2023 15:55:56 +0100 Subject: tv.iana.services: init --- modules/iana.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 modules/iana.nix (limited to 'modules') diff --git a/modules/iana.nix b/modules/iana.nix new file mode 100644 index 0000000..a63af8a --- /dev/null +++ b/modules/iana.nix @@ -0,0 +1,23 @@ +{ config, lib, ... }: { + options.tv.iana.services = lib.mkOption { + default = let + inherit (config.krebs.iana-etc) services; + in + builtins.foldl' + (result: port: lib.recursiveUpdate result { + ${services.${port}.tcp.name or null}.tcp.port = lib.toInt port; + ${services.${port}.udp.name or null}.udp.port = lib.toInt port; + }) + {} + (builtins.attrNames services); + readOnly = true; + type = lib.types.attrsOf (lib.types.submodule { + options.tcp.port = lib.mkOption { + type = lib.types.port; + }; + options.udp.port = lib.mkOption { + type = lib.types.port; + }; + }); + }; +} -- cgit v1.2.3