stateless-uptime-kuma/nixos/module.nix
2024-04-18 18:23:11 +02:00

36 lines
720 B
Nix

{
config,
lib,
pkgs,
...
}:
let
probesFormat = pkgs.formats.json { };
cfg = config.statelessUptimeKuma;
in
{
options.statelessUptimeKuma = {
build.json = lib.mkOption {
internal = true;
visible = false;
type = lib.types.package;
};
probesConfig = {
monitors = lib.mkOption {
inherit (probesFormat) type;
default = [ ];
};
tags = lib.mkOption {
inherit (probesFormat) type;
default = [ ];
};
notifications = lib.mkOption {
inherit (probesFormat) type;
default = [ ];
};
};
};
config.statelessUptimeKuma = {
build.json = probesFormat.generate "probes.json" cfg.probesConfig;
};
}