config/modules/services/node_exporter/default.nix

35 lines
762 B
Nix
Raw Normal View History

2023-08-18 09:31:19 +03:00
{
config,
lib,
myData,
...
}: {
options.mj.services.node_exporter = with lib.types; {
enable = lib.mkEnableOption "Enable node_exporter";
};
config = lib.mkIf config.mj.services.node_exporter.enable {
services.prometheus.exporters.node = {
enable = true;
enabledCollectors = ["systemd" "processes"];
port = myData.ports.exporters.node;
2023-08-25 09:55:21 +03:00
user = "node_exporter";
group = "node_exporter";
};
users.users.node_exporter = {
isSystemUser = true;
group = "node_exporter";
uid = myData.uidgid.node_exporter;
};
users.groups.node_exporter = {
gid = myData.uidgid.node_exporter;
2023-08-18 09:31:19 +03:00
};
mj.services.friendlyport.vpn.ports = [
myData.ports.exporters.node
];
};
}