homelab/machines/modules/node-exporter.nix
plasmagoat 5feb74d56d
All checks were successful
Hello World / test (push) Successful in 4s
colmena initial implementation for sandbox and monitor
2025-07-06 21:25:57 +02:00

40 lines
743 B
Nix

{
lib,
config,
# name,
# meta,
...
}:
with lib; let
cfg = config.nodeExporter;
in {
options.nodeExporter = {
enable = mkOption {
type = types.bool;
default = false;
};
port = mkOption {
type = types.number;
default = 9100;
};
extraConfig = mkOption {
type = types.attrs;
default = {};
};
};
config = mkIf cfg.enable {
networking.firewall.allowedTCPPorts = [cfg.port];
services.prometheus.exporters.node =
{
enable = true;
enabledCollectors = ["systemd"];
port = cfg.port;
extraFlags = ["--collector.ethtool" "--collector.softirqs" "--collector.tcpstat" "--collector.wifi"];
}
// cfg.extraConfig;
};
}