adyya-flake/services/monitoring/prometheus.mod.nix
Ittihadyya fdb6de025b
Some checks failed
/ Check formatting (push) Failing after 1s
hmm ?
2024-12-20 17:59:33 +02:00

42 lines
823 B
Nix

{
universal.modules = [
{
services.prometheus.exporters = {
node = {
enable = true;
enabledCollectors = ["systemd"];
port = 6703;
};
varnish.enable = true;
};
}
];
glucose.modules = [
({
nixpkgs,
molecules,
...
}: let
ip = i: "10.24.1.${toString i}";
ips = builtins.mapAttrs (nixpkgs.lib.const ip) molecules;
ips' = builtins.mapAttrs (ip: "${ip}:6703") ips;
in {
services.prometheus = {
enable = true;
port = 6750;
enableReload = true;
scrapeConfigs = [
{
job_name = "devices";
static_configs = [
{
targets = ips';
}
];
}
];
};
})
];
}