mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 17:31:34 +01:00
35 lines
736 B
Nix
35 lines
736 B
Nix
{ 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.local = [ cfg.domain ];
|
|
ports.tcp = [ cfg.port ];
|
|
};
|
|
|
|
services.uptime-kuma = {
|
|
enable = true;
|
|
settings.PORT = toString cfg.port;
|
|
};
|
|
|
|
custom = {
|
|
services.caddy.virtualHosts.${cfg.domain}.port = cfg.port;
|
|
|
|
persistence.directories = [ config.services.uptime-kuma.settings.DATA_DIR ];
|
|
};
|
|
};
|
|
}
|