chore(monitoring): nf-fmt-nix

This commit is contained in:
arcnmx 2024-05-30 14:10:18 -07:00
parent 6fb140c7e6
commit a0a7df1b0e
6 changed files with 164 additions and 141 deletions

View file

@ -7,8 +7,9 @@
inherit (lib.attrsets) attrValues;
inherit (lib.lists) concatMap toList;
allExporters = let
exporters = removeAttrs config.services.prometheus.exporters [ "unifi-poller" ];
in concatMap toList (attrValues exporters);
exporters = removeAttrs config.services.prometheus.exporters ["unifi-poller"];
in
concatMap toList (attrValues exporters);
in {
config = {
services.prometheus.exporters = {
@ -57,8 +58,11 @@ in {
}
];
};
networking.firewall.interfaces.lan.allowedTCPPorts = map (exporter:
mkIf (exporter.enable && !exporter.openFirewall) 999
) allExporters;
networking.firewall.interfaces.lan.allowedTCPPorts =
map (
exporter:
mkIf (exporter.enable && !exporter.openFirewall) exporter.port
)
allExporters;
};
}