summaryrefslogtreecommitdiffstats
path: root/modules/iana.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/iana.nix')
-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;
+ };
+ });
+ };
+}