postgresql: fix password setup

This commit is contained in:
ibizaman 2025-08-25 09:34:08 +02:00 committed by Pierre Penninckx
parent 60039df698
commit 682a01488b

View file

@ -131,8 +131,8 @@ in
};
pwdConfig = ensureCfgs: {
systemd.services.postgresql.postStart =
let
systemd.services.postgresql-setup.script = lib.mkAfter
(let
prefix = ''
psql -tA <<'EOF'
DO $$
@ -150,7 +150,7 @@ in
cfgsWithPasswords = builtins.filter (cfg: cfg.passwordFile != null) ensureCfgs;
in
if (builtins.length cfgsWithPasswords) == 0 then "" else
prefix + (lib.concatStrings (map exec cfgsWithPasswords)) + suffix;
prefix + (lib.concatStrings (map exec cfgsWithPasswords)) + suffix);
};
debugConfig = enableDebug: lib.mkIf enableDebug {