From 22a8365564e2579d72ea71f9df89fc9deaa7f28f Mon Sep 17 00:00:00 2001 From: Astro Date: Wed, 9 Aug 2023 10:37:45 +0200 Subject: [PATCH] nixos-module: let collectd access postgresql --- nixos-module.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nixos-module.nix b/nixos-module.nix index 16c66db..e767e44 100644 --- a/nixos-module.nix +++ b/nixos-module.nix @@ -156,6 +156,10 @@ in CREATE DATABASE caveman TEMPLATE template0 ENCODING UTF8; GRANT ALL PRIVILEGES ON DATABASE caveman TO ${dbUser}; ''; + ensureUsers = [ { + name = "collectd"; + ensurePermissions."DATABASE caveman" = "SELECT"; + } ]; }; services.collectd.plugins.postgresql = ''