nixos/grafana: ensure that declarative prometheus data-sources don't use direct access

Support for that was permanently dropped in Grafana 9.2.0, see also
f30795b088
This commit is contained in:
Maximilian Bosch 2022-10-13 10:28:29 +02:00
parent 955e01095a
commit 0df6c52026
No known key found for this signature in database
GPG Key ID: 9A6EEA275CA5BE0A

View File

@ -720,6 +720,12 @@ in {
assertion = cfg.smtp.password != opt.smtp.password.default -> cfg.smtp.passwordFile == null;
message = "Cannot set both password and passwordFile";
}
{
assertion = all
({ type, access, ... }: type == "prometheus" -> access != "direct")
cfg.provision.datasources;
message = "For datasources of type `prometheus`, the `direct` access mode is not supported anymore (since Grafana 9.2.0)";
}
];
systemd.services.grafana = {