teutat3s
69b976607f
All checks were successful
Flake checks / Check (pull_request) Successful in 8m33s
list of config.services.matrix-synapse.settings.listeners that sets type = "metrics" instead of just using the first element in the list
33 lines
1.1 KiB
Nix
33 lines
1.1 KiB
Nix
{ config, flake, lib, ... }:
|
|
let
|
|
# Find element in list config.services.matrix-synapse.settings.listeners
|
|
# that sets type = "metrics"
|
|
listenerWithMetrics = lib.findFirst
|
|
(listener:
|
|
listener.type == "metrics")
|
|
(throw "Found no matrix-synapse.settings.listeners.*.type containing string metrics")
|
|
config.services.matrix-synapse.settings.listeners
|
|
;
|
|
synapseMetricsPort = "${toString listenerWithMetrics.port}";
|
|
in
|
|
{
|
|
age.secrets.nachtigall-metrics-nginx-basic-auth = {
|
|
file = "${flake.self}/secrets/nachtigall-metrics-nginx-basic-auth.age";
|
|
mode = "600";
|
|
owner = "nginx";
|
|
};
|
|
services.nginx.virtualHosts = {
|
|
"nachtigall.pub.solar" = {
|
|
enableACME = true;
|
|
addSSL = true;
|
|
basicAuthFile = "${config.age.secrets.nachtigall-metrics-nginx-basic-auth.path}";
|
|
locations."/metrics" = {
|
|
proxyPass = "http://127.0.0.1:${toString(config.services.prometheus.exporters.node.port)}";
|
|
};
|
|
locations."/_synapse/metrics" = {
|
|
proxyPass = "http://127.0.0.1:${synapseMetricsPort}";
|
|
};
|
|
};
|
|
};
|
|
}
|