From fe11ecea2a45c6d9906646764d209bf3ac070d5f Mon Sep 17 00:00:00 2001 From: Will Holdsworth Date: Mon, 2 Mar 2026 23:22:07 +1100 Subject: [PATCH] feat(gatus): install --- modules/nixos/bundles/server.nix | 1 + modules/nixos/features/gatus.nix | 47 ++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 modules/nixos/features/gatus.nix diff --git a/modules/nixos/bundles/server.nix b/modules/nixos/bundles/server.nix index 305b7ba..c1eeded 100644 --- a/modules/nixos/bundles/server.nix +++ b/modules/nixos/bundles/server.nix @@ -10,6 +10,7 @@ "copyparty" "couchdb" "cryptpad" + "gatus" "homepage-dashboard" "immich" "jellyfin" diff --git a/modules/nixos/features/gatus.nix b/modules/nixos/features/gatus.nix new file mode 100644 index 0000000..c06fb6e --- /dev/null +++ b/modules/nixos/features/gatus.nix @@ -0,0 +1,47 @@ +let + port = 5025; + certloc = "/var/lib/acme/fi33.buzz"; +in +{ + services = { + gatus = { + enable = true; + settings = { + web = { + inherit port; + }; + endpoints = [ + { + name = "website"; + url = "https://twin.sh/health"; + interval = "5m"; + conditions = [ + "[STATUS] == 200" + "[BODY].status == UP" + "[RESPONSE_TIME] < 300" + ]; + } + ]; + }; + }; + + # borgmatic.settings = { + # source_directories = [ ]; + # postgresql_databases = [ + # { + # name = "gatus"; + # hostname = "localhost"; + # username = "root"; + # password = "{credential systemd borgmatic-pg}"; + # } + # ]; + # }; + + caddy.virtualHosts."uptime.fi33.buzz".extraConfig = '' + reverse_proxy localhost:${toString port} + tls ${certloc}/cert.pem ${certloc}/key.pem { + protocols tls1.3 + } + ''; + }; +}