From 61f9e302422fd66dcf3a2b7dd0d31f7727e48ba9 Mon Sep 17 00:00:00 2001 From: Bloxx12 Date: Wed, 9 Apr 2025 15:31:18 +0200 Subject: [PATCH 1/3] prometheus/module.nix: fix cfg --- modules/services/prometheus/module.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/prometheus/module.nix b/modules/services/prometheus/module.nix index bed6038..f978d0f 100644 --- a/modules/services/prometheus/module.nix +++ b/modules/services/prometheus/module.nix @@ -7,7 +7,7 @@ inherit (lib.modules) mkIf; inherit (lib.options) mkEnableOption; - cfg = config.modules.system.services.grafana; + cfg = config.modules.system.services.prometheus; port = 4022; in { options.modules.system.services.prometheus.enable = mkEnableOption "Grafana, a graphing service"; From 49969059eca65273af383d70acadeb7c314510f8 Mon Sep 17 00:00:00 2001 From: Bloxx12 Date: Wed, 9 Apr 2025 15:31:18 +0200 Subject: [PATCH 2/3] tower/configuration.nix: enable prometheus --- hosts/tower/configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/hosts/tower/configuration.nix b/hosts/tower/configuration.nix index daf0937..399ce58 100644 --- a/hosts/tower/configuration.nix +++ b/hosts/tower/configuration.nix @@ -36,6 +36,7 @@ services = { forgejo.enable = true; grafana.enable = true; + prometheus.enable = true; }; programs = { editors = { From 936d8f9090afb7934564c642aa9e7f8af495433a Mon Sep 17 00:00:00 2001 From: Bloxx12 Date: Wed, 9 Apr 2025 15:31:18 +0200 Subject: [PATCH 3/3] grafana/module.nix: fix datasources --- modules/services/grafana/module.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/services/grafana/module.nix b/modules/services/grafana/module.nix index 83d5b26..afeccb7 100644 --- a/modules/services/grafana/module.nix +++ b/modules/services/grafana/module.nix @@ -50,19 +50,19 @@ in { enable = true; datasources.settings = { datasources = [ - (mkIf config.modules.system.services.database.postgresql.enable { + (mkIf config.modules.system.services.prometheus.enable { name = "Prometheus"; type = "prometheus"; access = "proxy"; - url = "http://127.0.0.1:4024"; + url = "http://127.0.0.1:${toString config.services.prometheus.port}"; isDefault = true; }) - (mkIf config.modules.system.services.prometheus.enable { + (mkIf config.modules.system.services.database.postgresql.enable { name = "PostgreSQL"; type = "postgres"; access = "proxy"; - url = "http://127.0.0.1:${toString config.services.prometheus.port}"; + url = "http://127.0.0.1:${toString config.services.prometheus.exporters.postgres.port}"; }) ]; };