diff --git a/modules/system/web-services/uptime-kuma.nix b/modules/system/web-services/uptime-kuma.nix new file mode 100644 index 0000000..bcc18f7 --- /dev/null +++ b/modules/system/web-services/uptime-kuma.nix @@ -0,0 +1,31 @@ +{ config, lib, ... }: +let + cfg = config.custom.services.uptime-kuma; +in +{ + options.custom.services.uptime-kuma = { + enable = lib.mkEnableOption ""; + domain = lib.mkOption { + type = lib.types.nonEmptyStr; + default = ""; + }; + port = lib.mkOption { + type = lib.types.port; + default = 44019; + }; + }; + + config = lib.mkIf cfg.enable { + meta = { + domains.list = [ cfg.domain ]; + ports.tcp.list = [ cfg.port ]; + }; + + services.uptime-kuma = { + enable = true; + settings.PORT = toString cfg.port; + }; + + custom.persist.directories = [ config.services.uptime-kuma.settings.DATA_DIR ]; + }; +}