From 9c44d7d0fe5827f656486fb3004ad87f9800dd5d Mon Sep 17 00:00:00 2001 From: Moritz 'e1mo' Fromm Date: Thu, 31 Aug 2023 22:03:41 +0200 Subject: [PATCH] Fix monitoring firewall rules for hamilton Only relevant until #29 is merged --- services/monitoring/default.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/services/monitoring/default.nix b/services/monitoring/default.nix index 464d0ed..178aa69 100644 --- a/services/monitoring/default.nix +++ b/services/monitoring/default.nix @@ -8,6 +8,11 @@ inherit (lib) escapeRegex; inherit (config.networking) fqdn hostName; + # Absolute hack until https://github.com/chaos-jetzt/chaos-jetzt-nixfiles/pull/29 is merged + # But needed for us to have a working monitoring on our main matrix server (kinda important) + # FIXME: Remove when #29 is merged + monIf = if config.networking.hostName == "hamilton" then "enp7s0" else "ens10"; + # Basically a manual list of (legacy) hosts not yet migrated to NixOS # but on which we'd like to have included in the monitoring. externalTargets = let @@ -124,7 +129,7 @@ in { ]; }; - networking.firewall.interfaces.ens10.allowedTCPPorts = let + networking.firewall.interfaces.${monIf}.allowedTCPPorts = let inherit (config.services) prometheus; ifEnabled = x: lib.optional x.enable x.port; in (