2023-03-07 15:48:46 +00:00
|
|
|
{
|
|
|
|
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;
|
|
|
|
};
|
2023-10-28 22:44:26 +00:00
|
|
|
wireguard = {
|
|
|
|
enable = true;
|
|
|
|
openFirewall = true;
|
|
|
|
listenAddress = cfg.listenAddress;
|
|
|
|
};
|
2023-03-07 15:48:46 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|