From 62d2b6d593fee02604eb5f577d85b5697b06aac8 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Fri, 20 Jun 2025 21:40:19 +0200 Subject: [PATCH] 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 // {