From 74e0b678285d1a7330b84fd0060baa88995917a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Barnouin?= Date: Wed, 25 Sep 2024 13:36:18 +0200 Subject: [PATCH] Add external database for grafana --- flake.nix | 1 + services/grafana/default.nix | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/flake.nix b/flake.nix index ce319d2..022697e 100644 --- a/flake.nix +++ b/flake.nix @@ -27,6 +27,7 @@ system = "x86_64-linux"; username = "tbarnouin"; proxy_host = "192.168.1.40"; + pgsql_host = "192.168.1.13"; in { nixosConfigurations = { diff --git a/services/grafana/default.nix b/services/grafana/default.nix index fe3b57b..b07201e 100644 --- a/services/grafana/default.nix +++ b/services/grafana/default.nix @@ -23,6 +23,13 @@ in root_url = "https://logs.le43.eu"; serve_from_sub_path = false; }; + database = { + type = "postgres"; + host = "${cfg.pgsql_host}:5432"; + name = "grafana"; + user = "grafana"; + password = "\$__file{/run/secrets/grafana/database_secret}"; + }; auth = { signout_redirect_url = https://authentik.le43.eu/application/o/grafana/end-session/; oauth_auto_login = true;