From 2595a7ce5e65b2389f4d6af06b8e0ed3d998e2df Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 22 Mar 2023 18:12:21 +0100 Subject: [PATCH] modules/patroni: create dataDir --- modules/patroni/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/patroni/default.nix b/modules/patroni/default.nix index f64c5a5..bd13ad2 100644 --- a/modules/patroni/default.nix +++ b/modules/patroni/default.nix @@ -304,5 +304,9 @@ in environment.sessionVariables = { PATRONICTL_CONFIG_FILE = "${configFile}"; }; + + systemd.tmpfiles.rules = mkIf (cfg.postgresqlDataDir != "/var/lib/postgresql/${postgresql.psqlSchema}" || cfg.dataDir != "/var/lib/patroni") [ + "d '${cfg.dataDir}' 0700 ${cfg.user} ${cfg.group} - -" + ]; }; }