nichts/nyx/modules/options/system/services/monitoring.nix

27 lines
872 B
Nix
Raw Normal View History

2024-04-09 23:11:33 +02:00
{
config,
lib,
...
}: let
inherit (lib) mkEnableOption;
sys = config.modules.system;
cfg = sys.services;
# mkEnableOption is the same as mkEnableOption but with the default value being equal to cfg.monitoring.enable
mkEnableOption' = desc: mkEnableOption "${desc}" // {default = cfg.monitoring.enable;};
in {
options.modules.system.services = {
# monitoring tools
# TODO: how do I mkModule those? they feature multiple host-specific parts
# that need to be adressed
monitoring = {
enable = mkEnableOption "system monitoring stack";
prometheus.enable = mkEnableOption' "Prometheus monitoring service";
grafana.enable = mkEnableOption' "Grafana monitoring service";
loki.enable = mkEnableOption' "Loki monitoring service";
uptime-kuma.enable = mkEnableOption' "Uptime Kuma monitoring service";
};
};
}