30 lines
563 B
Nix
30 lines
563 B
Nix
|
{
|
||
|
lib,
|
||
|
config,
|
||
|
pkgs,
|
||
|
...
|
||
|
}:
|
||
|
with lib; let
|
||
|
psCfg = config.pub-solar;
|
||
|
cfg = config.pub-solar.monitoring-client;
|
||
|
in {
|
||
|
options.pub-solar.monitoring-client = {
|
||
|
enable = mkEnableOption "Install a monitoring client node";
|
||
|
listenAddress = mkOption {
|
||
|
type = types.str;
|
||
|
};
|
||
|
};
|
||
|
|
||
|
config = mkIf cfg.enable {
|
||
|
services.prometheus.exporters = {
|
||
|
node = {
|
||
|
enable = true;
|
||
|
enabledCollectors = ["systemd"];
|
||
|
port = 9002;
|
||
|
openFirewall = true;
|
||
|
listenAddress = cfg.listenAddress;
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
}
|