pvv-nixos-config/hosts/ildkule/services/metrics/grafana.nix

38 lines
973 B
Nix
Raw Normal View History

2022-12-19 22:56:42 +01:00
{ config, pkgs, ... }:
{
services.grafana = {
enable = true;
settings.server = {
domain = "ildkule.pvv.ntnu.no";
http_port = 2342;
http_addr = "127.0.0.1";
};
2022-12-20 00:26:29 +01:00
provision = {
enable = true;
datasources.settings.datasources = [
{
name = "Ildkule Prometheus";
type = "prometheus";
url = ("http://${config.services.prometheus.listenAddress}:${toString config.services.prometheus.port}");
isDefault = true;
}
];
};
2022-12-19 22:56:42 +01:00
};
services.nginx.virtualHosts.${config.services.grafana.domain} = {
locations = {
"/" = {
2022-12-20 00:26:29 +01:00
proxyPass = "http://${config.services.grafana.settings.server.http_addr}:${toString config.services.grafana.settings.server.http_port}";
2022-12-19 22:56:42 +01:00
proxyWebsockets = true;
extraConfig = ''
proxy_buffers 8 1024k;
proxy_buffer_size 1024k;
proxy_set_header Host $host;
'';
};
};
};
}