nixos-config/modules/prometheus/node_exporter.nix

21 lines
482 B
Nix
Raw Normal View History

2020-08-22 17:44:39 +02:00
{ config, ... }:
let
vpnNetRanges = config.networking.wireguard.interfaces.wg-home.ips;
vpnNetRange = builtins.elemAt vpnNetRanges 0;
vpnAddress = builtins.elemAt (builtins.split "/" vpnNetRange) 0;
in
{
imports = [
../wireguard/home.nix
];
services.prometheus.exporters.node = {
enable = true;
listenAddress = vpnAddress;
enabledCollectors = [ "systemd " ];
2020-08-22 17:44:39 +02:00
};
2020-08-22 17:56:50 +02:00
systemd.services.prometheus-node-exporter.after = [ "wireguard-wg-home.service" ];
2020-08-22 17:44:39 +02:00
}