diff --git a/machines/gerd.nix b/machines/gerd.nix index 58332cc..c1d5e14 100644 --- a/machines/gerd.nix +++ b/machines/gerd.nix @@ -38,14 +38,13 @@ disks = { disk = "/dev/sda"; pools.rpool.datasets = { - # zfs create -o quota=1G rpool/safe/svcs/uptime-kuma + # zfs create -o quota=1G rpool/safe/svcs/service-name "safe/svcs/forgejo" = { mountpoint = "/srv/forgejo"; extra.options.quota = "5G"; }; "safe/svcs/hedgedoc" = { mountpoint = "/srv/hedgedoc"; extra.options.quota = "5G"; }; "safe/svcs/nextcloud" = { mountpoint = "/srv/nextcloud"; extra.options.quota = "5G"; }; "safe/svcs/stalwart" = { mountpoint = "/srv/stalwart"; extra.options.quota = "5G"; }; "safe/svcs/synapse" = { mountpoint = "/srv/synapse"; extra.options.quota = "5G"; }; "safe/svcs/wger" = { mountpoint = "/srv/wger"; extra.options.quota = "5G"; }; - "safe/svcs/uptime-kuma" = { mountpoint = "/srv/uptime-kuma"; extra.options.quota = "1G"; }; "safe/svcs/postgresql" = { mountpoint = "/srv/postgresql"; extra.options.quota = "5G"; }; "backup/postgresql" = { mountpoint = "/media/backup/postgresqlbackup"; extra.options.quota = "5G"; }; }; diff --git a/machines/gerd/services/uptime-kuma.nix b/machines/gerd/services/uptime-kuma.nix index 78f0663..7e266eb 100644 --- a/machines/gerd/services/uptime-kuma.nix +++ b/machines/gerd/services/uptime-kuma.nix @@ -2,17 +2,11 @@ let svc_domain = "uptime-kuma.${config.mine.shared.settings.domain}"; - - stateDir = config.mine.zfsMounts."rpool/safe/svcs/uptime-kuma"; in { services.uptime-kuma = { enable = true; appriseSupport = true; - settings = { - DATA_DIR = lib.mkForce stateDir; - }; - package = pkgs.uptime-kuma.overrideAttrs (old: rec { pname = "uptime-kuma"; version = "2.0.0-dev"; @@ -47,21 +41,10 @@ in { }); }; - # setup state dir - systemd.services.uptime-kuma.serviceConfig = { - ExecStartPre = [ - "+${pkgs.coreutils}/bin/chown %u:%g -R ${stateDir}" - "+${pkgs.coreutils}/bin/chmod 777 -R ${stateDir}" - ]; - ReadWritePaths = [ stateDir ]; - BindPaths = [ stateDir ]; - }; - - - # TODO: Could maybe use this instead? - # environment.persistence.root.directories = [ - # { directory = "/var/lib/private/lldap"; mode = "0700"; } - # ]; + # setup persistence + environment.persistence.root.directories = [ + { directory = "/var/lib/private/uptime-kuma"; mode = "0700"; } + ]; # setup ldap user for email @@ -81,8 +64,8 @@ in { mine.shared.meta.uptime-kuma = { name = "Uptime Kuma"; - description = ''Fancy self-hosted monitoring tool, which supports VARIOUS methods of monitoring, as well as getting notifications. Multiple users is not officially support, so reach out to admins, and they will create a user for you. Abuse will NOT be tolerated.''; - url = svc_domain; + description = ''Fancy self-hosted monitoring tool, which supports VARIOUS methods of monitoring, as well as getting notifications. Multiple users is not officially support, so reach out to admins, and they will create a user for you. Abuse will NOT be tolerated. We have a SMTP account associated with Uptime Kuma, ask for details on how to use this (you're also allowed to to your own member email).''; + url = "https://${svc_domain}"; package = let pkg = config.services.uptime-kuma.package; @@ -92,6 +75,4 @@ in { meta = pkg.meta; }; }; - - }