summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2023-11-09 15:55:56 +0100
committertv <tv@krebsco.de>2023-11-09 15:55:56 +0100
commit16dec9b4382596f3979e4a23fc378484b18fad67 (patch)
tree1964966a6536f3f2d7c14ee928481ceac19895f8
parentc7159e1951dae3a8615a2de481ebbdbe3e4f0cfc (diff)
tv.iana.services: init
-rw-r--r--modules/iana.nix23
1 files changed, 23 insertions, 0 deletions
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;
+ };
+ });
+ };
+}