move node_exporter to its own module

This commit is contained in:
Motiejus Jakštys 2023-08-18 09:31:19 +03:00
parent 336cbb3525
commit bbf562d205
5 changed files with 28 additions and 26 deletions

View File

@ -67,9 +67,7 @@
}; };
services = { services = {
friendlyport.vpn.ports = [ node_exporter.enable = true;
myData.ports.exporters.node
];
deployerbot = { deployerbot = {
follower = { follower = {
@ -122,12 +120,6 @@
services = { services = {
tailscale.enable = true; tailscale.enable = true;
prometheus.exporters.node = {
enable = true;
enabledCollectors = ["systemd" "processes"];
port = myData.ports.exporters.node;
};
nsd = { nsd = {
enable = true; enable = true;
interfaces = ["0.0.0.0" "::"]; interfaces = ["0.0.0.0" "::"];

View File

@ -70,9 +70,10 @@
443 443
myData.ports.grafana myData.ports.grafana
myData.ports.prometheus myData.ports.prometheus
myData.ports.exporters.node
]; ];
node_exporter.enable = true;
nsd-acme = { nsd-acme = {
enable = true; enable = true;
zones."grafana.jakstys.lt" = { zones."grafana.jakstys.lt" = {
@ -181,13 +182,6 @@
prometheus = { prometheus = {
enable = true; enable = true;
port = myData.ports.prometheus; port = myData.ports.prometheus;
exporters = {
node = {
enable = true;
enabledCollectors = ["systemd" "processes"];
port = myData.ports.exporters.node;
};
};
globalConfig = { globalConfig = {
scrape_interval = "15s"; scrape_interval = "15s";

View File

@ -48,6 +48,8 @@
}; };
services = { services = {
node_exporter.enable = true;
postfix = { postfix = {
enable = true; enable = true;
saslPasswdPath = config.age.secrets.sasl-passwd.path; saslPasswdPath = config.age.secrets.sasl-passwd.path;
@ -60,18 +62,9 @@
publicKey = myData.hosts."vno1-oh2.servers.jakst".publicKey; publicKey = myData.hosts."vno1-oh2.servers.jakst".publicKey;
}; };
}; };
friendlyport.vpn.ports = [
myData.ports.exporters.node
];
}; };
}; };
services.prometheus.exporters.node = {
enable = true;
enabledCollectors = ["systemd" "processes"];
port = myData.ports.exporters.node;
};
services.tailscale.enable = true; services.tailscale.enable = true;
services.pipewire = { services.pipewire = {

View File

@ -7,6 +7,7 @@
imports = [ imports = [
./deployerbot ./deployerbot
./friendlyport ./friendlyport
./node_exporter
./nsd-acme ./nsd-acme
./postfix ./postfix
./syncthing ./syncthing

View File

@ -0,0 +1,22 @@
{
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;
};
mj.services.friendlyport.vpn.ports = [
myData.ports.exporters.node
];
};
}