nixos/modules/prometheus/client.nix
Jake Hillion 33cdcdca0a
All checks were successful
flake / flake (push) Successful in 1m15s
prometheus: enable systemd collector
2024-10-12 15:27:13 +01:00

25 lines
499 B
Nix

{ pkgs, lib, config, ... }:
let
cfg = config.custom.prometheus.client;
in
{
options.custom.prometheus.client = {
enable = lib.mkEnableOption "prometheus-client";
};
config = lib.mkIf cfg.enable {
users.users.node-exporter.uid = config.ids.uids.node-exporter;
users.groups.node-exporter.gid = config.ids.gids.node-exporter;
services.prometheus.exporters.node = {
enable = true;
port = 9000;
enabledCollectors = [
"systemd"
];
};
};
}