diff --git a/flake.nix b/flake.nix index 62d5e7e..2015db0 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,6 @@ # flake for blakes nixos config # define new devices in outputs -# generation: 366, timestamp: 2025-10-12 15:30:09 +# generation: 367, timestamp: 2025-10-12 15:34:36 { description = "blakes nix config"; inputs = { diff --git a/modules/homelab/services/glance/default.nix b/modules/homelab/services/glance/default.nix index ebb457b..ca5941d 100644 --- a/modules/homelab/services/glance/default.nix +++ b/modules/homelab/services/glance/default.nix @@ -21,6 +21,9 @@ let cfg = config.modules.services.${service}; sec = config.sops.secrets; homelab = config.modules.homelab; + + uptimekuma_url = "localhost:7901"; + uptimekuma_page = "glance"; in { options.modules.services.${service} = { @@ -165,11 +168,11 @@ in { type = "custom-api"; title = "uptime"; - title-url = "127.0.0.1:7901"; - url = "127.0.0.1:7901/api/status-page/glance"; - subrequests = {heartbeats = {url = "127.0.0.1:7901/api/status-page/heartbeat/glance";};}; + title-url = "\${uptimekuma_url}"; + url = "\${uptimekuma_url}/api/status-page/\${uptimekuma_page}"; + subrequests = {heartbeats = {url = "\${uptimekuma_url}/api/status-page/heartbeat/\${uptimekuma_page}";};}; cache = "10m"; - template = "{{ $hb := .Subrequest \"heartbeats\" }}\n\n{{ if not (.JSON.Exists \"publicGroupList\") }}\n
Error reading response
\n{{ else if eq (len (.JSON.Array \"publicGroupList\")) 0 }}\nNo monitors found
\n{{ else }}\n\nError reading response
\n{{ else if eq (len (.JSON.Array \"publicGroupList\")) 0 }}\nNo monitors found
\n{{ else }}\n\n