nixos/roundcube: fix postgresql.package regression

`config.services.postgresql.package` is now only available when the
PostgreSQL module is actually enabled. If we're not using the local
database, we'll need to fallback to the latest postgresql version, since
we don't know about the remote version.
This commit is contained in:
Wolfgang Walther
2025-06-20 21:39:52 +02:00
parent da3beb2a08
commit e780b064a8

View File

@@ -272,7 +272,7 @@ in
];
systemd.services.roundcube-setup = lib.mkMerge [
(lib.mkIf (cfg.database.host == "localhost") {
(lib.mkIf localDB {
requires = [ "postgresql.service" ];
after = [ "postgresql.service" ];
})
@@ -281,7 +281,9 @@ in
after = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
path = [ config.services.postgresql.package ];
path = [
(if localDB then config.services.postgresql.package else pkgs.postgresql)
];
script =
let
psql = "${lib.optionalString (!localDB) "PGPASSFILE=${cfg.database.passwordFile}"} psql ${