From 970fe01fdaa396fab05085646d3017af0a8b3f64 Mon Sep 17 00:00:00 2001 From: prescientmoon Date: Sat, 24 Feb 2024 07:19:34 +0100 Subject: [PATCH] Update permissions for grafana and prometheus --- hosts/nixos/lapetus/services/grafana.nix | 8 +++++--- hosts/nixos/lapetus/services/prometheus.nix | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/hosts/nixos/lapetus/services/grafana.nix b/hosts/nixos/lapetus/services/grafana.nix index c2e9deb..d7edc33 100644 --- a/hosts/nixos/lapetus/services/grafana.nix +++ b/hosts/nixos/lapetus/services/grafana.nix @@ -58,8 +58,10 @@ in services.nginx.virtualHosts.${config.services.grafana.settings.server.domain} = config.satellite.proxy config.services.grafana.settings.server.http_port { }; - environment.persistence."/persist/state".directories = [ - config.services.grafana.dataDir - ]; + environment.persistence."/persist/state".directories = [{ + directory = config.services.grafana.dataDir; + user = "grafana"; + group = "grafana"; + }]; # }}} } diff --git a/hosts/nixos/lapetus/services/prometheus.nix b/hosts/nixos/lapetus/services/prometheus.nix index 8ecd30f..cbb3467 100644 --- a/hosts/nixos/lapetus/services/prometheus.nix +++ b/hosts/nixos/lapetus/services/prometheus.nix @@ -34,8 +34,10 @@ in config.services.grafana.port { proxyWebsockets = true; }; - environment.persistence."/persist/state".directories = [ - "/var/lib/prometheus2" - ]; + environment.persistence."/persist/state".directories = [{ + directory = "/var/lib/prometheus2"; + user = "prometheus"; + group = "prometheus"; + }]; # }}} }