postgresql: fix password setup
This commit is contained in:
parent
60039df698
commit
682a01488b
1 changed files with 3 additions and 3 deletions
|
|
@ -131,8 +131,8 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
pwdConfig = ensureCfgs: {
|
pwdConfig = ensureCfgs: {
|
||||||
systemd.services.postgresql.postStart =
|
systemd.services.postgresql-setup.script = lib.mkAfter
|
||||||
let
|
(let
|
||||||
prefix = ''
|
prefix = ''
|
||||||
psql -tA <<'EOF'
|
psql -tA <<'EOF'
|
||||||
DO $$
|
DO $$
|
||||||
|
|
@ -150,7 +150,7 @@ in
|
||||||
cfgsWithPasswords = builtins.filter (cfg: cfg.passwordFile != null) ensureCfgs;
|
cfgsWithPasswords = builtins.filter (cfg: cfg.passwordFile != null) ensureCfgs;
|
||||||
in
|
in
|
||||||
if (builtins.length cfgsWithPasswords) == 0 then "" else
|
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 {
|
debugConfig = enableDebug: lib.mkIf enableDebug {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue