From 339eac52c67453437bcbda77c5466598539ca2e2 Mon Sep 17 00:00:00 2001 From: Zuckerberg Date: Sun, 22 Feb 2026 15:49:26 -0800 Subject: [PATCH] Add uptime kuma --- common/server/default.nix | 1 + common/server/uptime-kuma.nix | 36 +++++++++++++++++++++++++++++++++++ machines/ponyo/default.nix | 4 ++++ 3 files changed, 41 insertions(+) create mode 100644 common/server/uptime-kuma.nix diff --git a/common/server/default.nix b/common/server/default.nix index 4dec0ea..23002d1 100644 --- a/common/server/default.nix +++ b/common/server/default.nix @@ -17,5 +17,6 @@ ./actualbudget.nix ./unifi.nix ./ntfy.nix + ./uptime-kuma.nix ]; } diff --git a/common/server/uptime-kuma.nix b/common/server/uptime-kuma.nix new file mode 100644 index 0000000..856a32f --- /dev/null +++ b/common/server/uptime-kuma.nix @@ -0,0 +1,36 @@ +{ lib, config, ... }: + +let + cfg = config.services.uptime-kuma; + port = 3001; +in +{ + options.services.uptime-kuma = { + hostname = lib.mkOption { + type = lib.types.str; + example = "status.example.com"; + }; + }; + + config = lib.mkIf cfg.enable { + services.uptime-kuma.settings = { + HOST = "127.0.0.1"; + PORT = toString port; + }; + + # backups + backup.group."uptime-kuma".paths = [ + "/var/lib/uptime-kuma" + ]; + + services.nginx.enable = true; + services.nginx.virtualHosts.${cfg.hostname} = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:${toString port}"; + proxyWebsockets = true; + }; + }; + }; +} diff --git a/machines/ponyo/default.nix b/machines/ponyo/default.nix index 729ac9d..c60d127 100644 --- a/machines/ponyo/default.nix +++ b/machines/ponyo/default.nix @@ -112,4 +112,8 @@ # push notifications services.ntfy-sh.enable = true; services.ntfy-sh.hostname = "ntfy.neet.dev"; + + # uptime monitoring + services.uptime-kuma.enable = true; + services.uptime-kuma.hostname = "status.neet.dev"; }