Ensure state directory exists & belongs to grafana

This commit is contained in:
niten 2023-12-10 11:07:59 -08:00
parent 7d69953ffb
commit 810f6a5bca
1 changed files with 4 additions and 0 deletions

View File

@ -94,6 +94,10 @@ in {
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
systemd.tmpfiles.rules = [
"d ${cfg.state-directory} 0700 ${config.systemd.services.grafana.serviceConfig.User} root - -"
];
services.grafana = { services.grafana = {
enable = true; enable = true;
dataDir = "${cfg.state-directory}/data"; dataDir = "${cfg.state-directory}/data";