nixos-config/modules/prometheus/node_exporter.nix

20 lines
442 B
Nix

{ 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;
};
systemd.services.prometheus-node-exporter.after = [ "wireguard-wg-home.service" ];
}