From 810f6a5bca01775ee41c8b31fd5386c2bc275da5 Mon Sep 17 00:00:00 2001 From: niten Date: Sun, 10 Dec 2023 11:07:59 -0800 Subject: [PATCH] Ensure state directory exists & belongs to grafana --- grafana.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/grafana.nix b/grafana.nix index 86b11fc..3e42c9a 100644 --- a/grafana.nix +++ b/grafana.nix @@ -94,6 +94,10 @@ in { }; config = mkIf cfg.enable { + systemd.tmpfiles.rules = [ + "d ${cfg.state-directory} 0700 ${config.systemd.services.grafana.serviceConfig.User} root - -" + ]; + services.grafana = { enable = true; dataDir = "${cfg.state-directory}/data";