mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2025-12-30 12:18:23 +01:00
27 lines
615 B
Nix
27 lines
615 B
Nix
{ config, lib, values, ... }:
|
|
let
|
|
cfg = config.services.prometheus.exporters.systemd;
|
|
in
|
|
{
|
|
services.prometheus.exporters.systemd = {
|
|
enable = lib.mkDefault true;
|
|
port = 9101;
|
|
extraFlags = [
|
|
"--systemd.collector.enable-restart-count"
|
|
"--systemd.collector.enable-ip-accounting"
|
|
];
|
|
};
|
|
|
|
systemd.services.prometheus-systemd-exporter.serviceConfig = {
|
|
IPAddressDeny = "any";
|
|
IPAddressAllow = [
|
|
"127.0.0.1"
|
|
"::1"
|
|
values.hosts.ildkule.ipv4
|
|
values.hosts.ildkule.ipv6
|
|
];
|
|
};
|
|
|
|
networking.firewall.allowedTCPPorts = lib.mkIf cfg.enable [ cfg.port ];
|
|
}
|