chore: nf-fmt-nix

This commit is contained in:
arcnmx 2024-07-31 11:13:50 -07:00
parent c2726dd41b
commit ffde3c1c27
14 changed files with 170 additions and 131 deletions

View file

@ -23,7 +23,10 @@
}: let
port = service.ports.${portName};
# TODO: this properly
getAddressFor = if port.status.gatus.client.network or "ip" == "ip4" then "getAddress4For" else "getAddressFor";
getAddressFor =
if port.status.gatus.client.network or "ip" == "ip4"
then "getAddress4For"
else "getAddressFor";
in "${mkAddress6 (access.${getAddressFor} system.name "lan")}:${toString port.port}";
mkServiceConfig = system: serviceName: let
inherit (service.prometheus) exporter;

View file

@ -75,8 +75,10 @@ in {
allowedTCPPorts = map mkExporterPort exporters;
res = builtins.tryEval (any (enablePort true) exporters);
cond = lib.warnIf (!res.success) "broken prometheus exporter: ${name}" res.value;
in mkIf cond allowedTCPPorts;
in
mkIf cond allowedTCPPorts;
mkExporterPort = exporter: mkIf (enablePort false exporter) exporter.port;
in mkMerge (mapAttrsToList mkExporterPorts allExporters);
in
mkMerge (mapAttrsToList mkExporterPorts allExporters);
};
}