nix-config/hosts/nixedo/services/uptime-kuma.nix
Oliver Davies 92ded26806
All checks were successful
/ check (push) Successful in 1m15s
Rename baseDomain to domain
2025-05-03 11:11:57 +01:00

55 lines
1.1 KiB
Nix

{ config, lib, ... }:
with lib;
let
cfg = homelab.services.${service};
homelab = config.features.homelab;
service = "uptime-kuma";
in
{
options.features.homelab.services.${service} = {
enable = mkEnableOption "Enable ${service}";
url = mkOption {
default = "uptime.${homelab.domain}";
type = types.str;
};
homepage.name = mkOption {
default = "Uptime Kuma";
type = types.str;
};
homepage.description = mkOption {
default = "A fancy self-hosted monitoring tool";
type = types.str;
};
homepage.icon = mkOption {
default = "uptime-kuma";
type = types.str;
};
homepage.category = mkOption {
default = "Services";
type = types.str;
};
};
config = mkIf cfg.enable {
services = {
${service}.enable = true;
nginx.virtualHosts.${cfg.url} = {
forceSSL = true;
useACMEHost = homelab.domain;
locations."/" = {
proxyPass = "http://localhost:${toString config.services.${service}.settings.PORT}";
recommendedProxySettings = true;
};
};
};
};
}