about summary refs log tree commit diff stats
path: root/modules/by-name/sy/system-info/module.nix
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-04-24 17:43:21 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-04-24 17:43:21 +0200
commit80b61231200fa29ff23b32bc57b4e2a47ee5daa4 (patch)
treecc8ab29f844597372861e2b6b729b68478aafc05 /modules/by-name/sy/system-info/module.nix
parentmodules/matrix: Use the typed NixOS for user and db creation (diff)
downloadnixos-server-80b61231200fa29ff23b32bc57b4e2a47ee5daa4.zip
modules/system-info: Provide a nice warning message, if a port is not yet registered
Diffstat (limited to '')
-rw-r--r--modules/by-name/sy/system-info/module.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/by-name/sy/system-info/module.nix b/modules/by-name/sy/system-info/module.nix
index 5e2da31..8136ae5 100644
--- a/modules/by-name/sy/system-info/module.nix
+++ b/modules/by-name/sy/system-info/module.nix
@@ -38,9 +38,16 @@
 
       # TODO(@bpeetz): Check which service opens these ports: <2025-01-28>
       "64738" = "???";
+      "4190" = "???";
     };
   in ''
-    ${mode} ${builtins.toString port}: ${mappings.${builtins.toString port}}
+    ${mode} ${builtins.toString port}: ${
+      if (builtins.hasAttr "${builtins.toString port}" mappings)
+      then mappings.${builtins.toString port}
+      else
+        builtins.throw
+        "'${builtins.toString port}' is still missing from the system info port -> name map. Maybe add it?"
+    }
   '';
 
   # TODO(@bpeetz): This should probably also include the allowed TCP/UDP port ranges. <2025-01-28>