From 3cbec59b6d663541684adf22344f48e95693956e Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Sat, 23 Aug 2025 23:42:01 +0200 Subject: [PATCH] gatus: Remove host endpoints --- hosts/srv-monitor/default.nix | 8 +------- modules/system/services/gatus.nix | 23 ++--------------------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/hosts/srv-monitor/default.nix b/hosts/srv-monitor/default.nix index 7d7dd11..2e74f42 100644 --- a/hosts/srv-monitor/default.nix +++ b/hosts/srv-monitor/default.nix @@ -1,9 +1,4 @@ -{ - config, - self, - lib, - ... -}: +{ config, ... }: { system.stateVersion = "24.11"; @@ -31,7 +26,6 @@ enable = true; domain = "status.${config.custom.services.tailscale.domain}"; domainsToMonitor = config.meta.domains.globalList; - hostsToMonitor = self.nixosConfigurations |> lib.attrNames; customEndpoints = { "alerts" = { group = "Monitoring"; diff --git a/modules/system/services/gatus.nix b/modules/system/services/gatus.nix index 852bcdb..080c31c 100644 --- a/modules/system/services/gatus.nix +++ b/modules/system/services/gatus.nix @@ -38,7 +38,7 @@ in ) ); - defaultDomainEndpoints = + defaultEndpoints = let getSubdomain = domain: domain |> lib.splitString "." |> lib.head; in @@ -46,19 +46,6 @@ in |> lib.filter (domain: domain != cfg.domain) |> lib.map (domain: lib.nameValuePair (getSubdomain domain) { url = "https://${domain}"; }) |> lib.listToAttrs; - - defaultHostEndpoints = - cfg.hostsToMonitor - |> lib.filter (hostName: hostName != config.networking.hostName) - |> lib.map ( - hostName: - lib.nameValuePair hostName { - group = "Hosts"; - url = "icmp://${hostName}.${config.custom.services.tailscale.domain}"; - enableAlerts = false; - } - ) - |> lib.listToAttrs; in { enable = lib.mkEnableOption ""; @@ -74,17 +61,13 @@ in type = lib.types.listOf lib.types.nonEmptyStr; default = [ ]; }; - hostsToMonitor = lib.mkOption { - type = lib.types.listOf lib.types.nonEmptyStr; - default = [ ]; - }; customEndpoints = lib.mkOption { type = endpointType; default = { }; }; finalEndpoints = lib.mkOption { type = endpointType; - default = defaultDomainEndpoints // defaultHostEndpoints // cfg.customEndpoints; + default = defaultEndpoints // cfg.customEndpoints; readOnly = true; }; }; @@ -180,7 +163,5 @@ in cfg.finalEndpoints |> lib.attrValues |> lib.map (entry: mkEndpoint entry); }; }; - - systemd.services.gatus.serviceConfig.AmbientCapabilities = "CAP_NET_RAW"; # Allow icmp/pings }; }