From 25e4fe68b1fb81df90b38db7b60c8c6a716fbf81 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Fri, 20 Jun 2025 21:39:52 +0200 Subject: [PATCH] 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. (cherry picked from commit e780b064a859f056b3ad02502965822cd1d815d8) --- nixos/modules/services/mail/roundcube.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/mail/roundcube.nix b/nixos/modules/services/mail/roundcube.nix index 7cb723e3172c..c31c4b069928 100644 --- a/nixos/modules/services/mail/roundcube.nix +++ b/nixos/modules/services/mail/roundcube.nix @@ -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 ${