From 3c830bc6c467f73d6e7aeb2d33b1405cdd6bdbe8 Mon Sep 17 00:00:00 2001 From: Lillian-Violet Date: Tue, 26 Mar 2024 14:52:15 +0100 Subject: [PATCH] Had to do a toString, thanks for the great error message nixos, fixed some other typos --- .../dashboard/grafana/default.nix | 37 ++++++++++--------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/nixos/server/package-configs/dashboard/grafana/default.nix b/nixos/server/package-configs/dashboard/grafana/default.nix index b952195..5589873 100644 --- a/nixos/server/package-configs/dashboard/grafana/default.nix +++ b/nixos/server/package-configs/dashboard/grafana/default.nix @@ -12,22 +12,25 @@ http_addr = "127.0.0.1"; }; provision = { - datasources = [ - { - name = "Prometheus"; - type = "prometheus"; - access = "proxy"; - url = "http://localhost:${config.services.prometheus.port}"; - isDefault = true; - } - # { - # name = "Loki"; - # type = "loki"; - # access = "proxy"; - # url = "http://localhost:${config.services.loki.port}"; - # isDefault = true; - # } - ]; + datasources.settings = { + apiVersion = 1; + datasources = [ + { + name = "Prometheus"; + type = "prometheus"; + access = "proxy"; + url = "http://localhost:${toString config.services.prometheus.port}"; + isDefault = true; + } + # { + # name = "Loki"; + # type = "loki"; + # access = "proxy"; + # url = "http://localhost:${config.services.loki.port}"; + # isDefault = true; + # } + ]; + }; }; }; @@ -38,7 +41,7 @@ ## LetsEncrypt enableACME = true; locations."/" = { - proxyPass = "http://127.0.0.1:${toString config.services.grafana.settings.server.port}"; + proxyPass = "http://${toString config.services.grafana.settings.server.http_addr}:${toString config.services.grafana.settings.server.http_port}"; proxyWebsockets = true; }; };