stateless-uptime-kuma/nixos/module.nix

32 lines
708 B
Nix
Raw Normal View History

2024-04-18 18:19:59 +02:00
{ 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;
};
}