summaryrefslogtreecommitdiff
path: root/services/uptimekuma.nix
diff options
context:
space:
mode:
authorJakub Stachurski <jakub@wilkuu.xyz>2026-02-11 15:35:44 +0100
committerGitHub <noreply@github.com>2026-02-11 15:35:44 +0100
commit04707c728441000d64d3d750916354310ff2d2ab (patch)
treea6855656f35bc4c351e215827b58a83b4f2a99ec /services/uptimekuma.nix
parent2f65e7f40e97f6ccb3d164169698033ce1692a76 (diff)
Omega-Relay host replacement for Ubuntu VM on Feox
* Add omega-relay prototype host * Add omega-relay prototype host * Inital commit for working omega-relay host. This commit includes: - Mysql module from umbriel - Disko configuration for the Ferox VM - Freshrss module - Stalwart module - Vaultwarden module - Wakapi module - Uptime Kuma module - Support for using mysql socket - Server user that does not depend on full home-manager preset. - ACME for wilkuu.xyz domains, including all the services. * Nix fmt * Fixes in secrets and services. Mostly fixes connection to mysql and the unix-socket auth for it. * Little fixes and update * Format and do fixes * Update secrets and keys for omega-relay * Apply changes from messing around and making things work
Diffstat (limited to 'services/uptimekuma.nix')
-rw-r--r--services/uptimekuma.nix79
1 files changed, 79 insertions, 0 deletions
diff --git a/services/uptimekuma.nix b/services/uptimekuma.nix
new file mode 100644
index 0000000..720040d
--- /dev/null
+++ b/services/uptimekuma.nix
@@ -0,0 +1,79 @@
+{ config, lib, ... }:
+let
+ cfg = config.wilkuu.services.uptimekuma;
+ hostname = config.networking.hostName;
+in
+{
+ options.wilkuu.services.uptimekuma = with lib; {
+ domain = mkOption {
+ type = types.str;
+ default = "uptime.${hostname}.local";
+ example = "uptime.wilkuu.xyz";
+ description = "Domain for http connections.";
+ };
+ doACME = mkEnableOption "Enable ACME for uptime kuma here";
+ enable = mkEnableOption "Enable the uptime-kuma service";
+ dataDir = mkOption {
+ type = types.path;
+ description = "Storage localtion for uptime kuma data, currently ignored, because nixpkgs sucks";
+ default = "/srv/data/uptimekuma";
+ example = "/srv/data/uptimekuma";
+ };
+ };
+
+ config = lib.mkIf cfg.enable ({
+ networking.hosts = {
+ "127.0.0.1" = [ cfg.domain ];
+ };
+
+ users.users.uptimekuma = {
+ isSystemUser = true;
+ group = "uptimekuma";
+ };
+ users.groups.uptimekuma = { };
+
+ systemd.services.uptime-kuma.serviceConfig.User = "uptimekuma";
+ systemd.services.uptime-kuma.after = [ "mysql.service" ];
+
+ # sops.secrets =
+ # (lib.genAttrs (map toSops secrets)
+ # (name: {
+ # sopsFile = sopsPath;
+ # mode = "0440";
+ # owner = "uptime-kuma";
+ # }));
+
+ services.nginx.virtualHosts."${cfg.domain}" = {
+ addSSL = cfg.doACME;
+ enableACME = cfg.doACME;
+ locations."/" = {
+ proxyPass = "http://localhost:3111";
+ recommendedProxySettings = true;
+ };
+ };
+
+ wilkuu.services.mysql =
+ let
+ user = config.systemd.services.uptime-kuma.serviceConfig.User;
+ in
+ {
+ unix_users = [ user ];
+ databases.uptimekuma = {
+ enable = true;
+ allowedUsers = [ user ];
+ };
+ };
+
+ services.uptime-kuma = {
+ enable = true;
+ settings = {
+ UPTIME_KUMA_PORT = "3111";
+ UPTIME_KUMA_HOST = "127.0.0.1";
+ UPTIME_KUMA_DB_TYPE = "sqlite";
+ #UPTIME_KUMA_DB_SOCKET = "/run/mysqld/mysqld.sock";
+ #UPTIME_KUMA_DB_USERNAME = config.systemd.services.uptime-kuma.serviceConfig.User;
+ #UPTIME_KUMA_DB_NAME = "uptimekuma";
+ };
+ };
+ });
+}