From 2c4f215b6ec073f720bd0a285aeb9f1a495949b5 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Tue, 4 Jul 2023 17:05:56 -0600 Subject: [PATCH] define grafana settings explicitly --- modules/nixos/services/grafana.nix | 7 +++++-- modules/nixos/services/prometheus.nix | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/nixos/services/grafana.nix b/modules/nixos/services/grafana.nix index bd2e735..6f10dfa 100644 --- a/modules/nixos/services/grafana.nix +++ b/modules/nixos/services/grafana.nix @@ -8,8 +8,11 @@ config = lib.mkIf config.services.grafana.enable { - # Required to fix error in latest nixpkgs - services.grafana.settings = { }; + services.grafana.settings = { + http_addr = "127.0.0.1"; + http_port = 3000; + domain = config.metricsServer; + }; caddy.routes = [{ match = [{ host = [ config.metricsServer ]; }]; diff --git a/modules/nixos/services/prometheus.nix b/modules/nixos/services/prometheus.nix index afc21cc..034e9c8 100644 --- a/modules/nixos/services/prometheus.nix +++ b/modules/nixos/services/prometheus.nix @@ -19,6 +19,7 @@ }]; webExternalUrl = lib.mkIf config.services.grafana.enable "https://${config.prometheusServer}"; + # Web config file: https://prometheus.io/docs/prometheus/latest/configuration/https/ webConfigFile = lib.mkIf config.services.grafana.enable (pkgs.formats.yaml { }).generate "webconfig.yml" {