2025-03-23 21:48:46 +00:00
|
|
|
{config, ...}: let
|
|
|
|
virtualHostName = "grafana.helveticanonstandard.net";
|
|
|
|
in {
|
2025-03-01 21:21:00 +00:00
|
|
|
services.grafana = {
|
|
|
|
enable = true;
|
|
|
|
|
2025-03-23 21:58:49 +00:00
|
|
|
settings = {
|
|
|
|
server = {
|
|
|
|
domain = virtualHostName;
|
|
|
|
http_port = 9010;
|
|
|
|
http_addr = "127.0.0.1";
|
|
|
|
root_url = "http://192.168.1.10:8010"; # TODO
|
|
|
|
protocol = "http";
|
|
|
|
};
|
2025-03-01 21:21:00 +00:00
|
|
|
|
2025-03-23 21:58:49 +00:00
|
|
|
analytics.reporting_enabled = false;
|
|
|
|
};
|
2025-03-01 21:21:00 +00:00
|
|
|
|
|
|
|
provision = {
|
|
|
|
enable = true;
|
2025-03-09 15:37:21 +00:00
|
|
|
datasources.settings.datasources = [
|
2025-03-01 21:21:00 +00:00
|
|
|
{
|
|
|
|
name = "Prometheus";
|
|
|
|
type = "prometheus";
|
|
|
|
access = "proxy";
|
2025-03-23 21:48:46 +00:00
|
|
|
url = "http://127.0.0.1:${builtins.toString config.services.prometheus.port}";
|
2025-03-01 21:21:00 +00:00
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "Loki";
|
|
|
|
type = "loki";
|
|
|
|
access = "proxy";
|
2025-03-23 21:48:46 +00:00
|
|
|
url = "http://127.0.0.1:${builtins.toString config.services.loki.configuration.server.http_listen_port}";
|
2025-03-01 21:21:00 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2025-03-23 21:50:17 +00:00
|
|
|
# services.nginx.virtualHosts.${virtualHostName} = {
|
|
|
|
# locations."/" = {
|
|
|
|
# proxyPass = let
|
|
|
|
# host = config.services.grafana.settings.server.http_addr;
|
|
|
|
# port = builtins.toString config.services.grafana.settings.server.http_port;
|
|
|
|
# in "http://${host}:${port}";
|
|
|
|
# proxyWebsockets = true;
|
|
|
|
# };
|
|
|
|
# };
|
2025-03-01 21:21:00 +00:00
|
|
|
}
|