nixos/postgresql: fix setup script

The missing () caused parts of the escripts to be added to the
ExecStartPost line instead of inside the script.

This caused postgresql start to fail under certain conditions.
This commit is contained in:
Pascal Bach 2020-08-06 19:45:14 +02:00
parent 0db9545355
commit cee4e14bdf

View File

@ -333,7 +333,7 @@ in
# Wait for PostgreSQL to be ready to accept connections.
ExecStartPost =
let
setupScript = pkgs.writeScript "postgresql-setup" ''
setupScript = pkgs.writeScript "postgresql-setup" (''
#!${pkgs.runtimeShell} -e
PSQL="${pkgs.utillinux}/bin/runuser -u ${cfg.superUser} -- psql --port=${toString cfg.port}"
@ -360,7 +360,7 @@ in
$PSQL -tAc 'GRANT ${permission} ON ${database} TO "${user.name}"'
'') user.ensurePermissions)}
'') cfg.ensureUsers}
'';
'');
in
"+${setupScript}";
}