nixos/roundcube: fix roundcube-setup start

When using Roundcube with a non local PostgreSQL database wait for
network start before running roundcube-setup.service
Otherwise the database is not reachable and the service fails.
This commit is contained in:
Andreas Brinner 2023-04-23 12:16:43 +02:00
parent 2af4a9bc09
commit 279eeae178

View file

@ -231,6 +231,7 @@ in
path = [ config.services.postgresql.package ];
})
{
after = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
script = let
psql = "${lib.optionalString (!localDB) "PGPASSFILE=${cfg.database.passwordFile}"} ${pkgs.postgresql}/bin/psql ${lib.optionalString (!localDB) "-h ${cfg.database.host} -U ${cfg.database.username} "} ${cfg.database.dbname}";