From da3beb2a08b791e5b034aba4a83c16ff7f032c31 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Fri, 20 Jun 2025 21:39:05 +0200 Subject: [PATCH 1/3] nixos/libeufin: 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. --- nixos/modules/services/finance/libeufin/common.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/finance/libeufin/common.nix b/nixos/modules/services/finance/libeufin/common.nix index 4e0a6bffe02f..20b99ce9c396 100644 --- a/nixos/modules/services/finance/libeufin/common.nix +++ b/nixos/modules/services/finance/libeufin/common.nix @@ -96,7 +96,9 @@ libeufinComponent: }; in { - path = [ config.services.postgresql.package ]; + path = [ + (if cfg.createLocalDatabase then config.services.postgresql.package else pkgs.postgresql) + ]; serviceConfig = { Type = "oneshot"; DynamicUser = true; From e780b064a859f056b3ad02502965822cd1d815d8 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Fri, 20 Jun 2025 21:39:52 +0200 Subject: [PATCH 2/3] 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. --- 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 ${ From 62d2b6d593fee02604eb5f577d85b5697b06aac8 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Fri, 20 Jun 2025 21:40:19 +0200 Subject: [PATCH 3/3] nixos/immich: 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. --- nixos/modules/services/web-apps/immich.nix | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/web-apps/immich.nix b/nixos/modules/services/web-apps/immich.nix index a647b552678f..28e89709afde 100644 --- a/nixos/modules/services/web-apps/immich.nix +++ b/nixos/modules/services/web-apps/immich.nix @@ -46,6 +46,9 @@ let mkOption mkEnableOption ; + + postgresqlPackage = + if cfg.database.enable then config.services.postgresql.package else pkgs.postgresql; in { options.services.immich = { @@ -265,7 +268,7 @@ in in [ '' - ${lib.getExe' config.services.postgresql.package "psql"} -d "${cfg.database.name}" -f "${sqlFile}" + ${lib.getExe' postgresqlPackage "psql"} -d "${cfg.database.name}" -f "${sqlFile}" '' ]; @@ -333,7 +336,7 @@ in path = [ # gzip and pg_dumpall are used by the backup service pkgs.gzip - config.services.postgresql.package + postgresqlPackage ]; serviceConfig = commonServiceConfig // {