From cb30307559c68ded893654a622205a3d7d60d8a8 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Sun, 22 Jun 2025 12:45:10 +0200 Subject: [PATCH] nixos/immich: assert postgresql is below v17 We recently bumped the default PostgreSQL version to v17 in the NixOS module. This breaks immich, which still needs PostgreSQL 16. --- nixos/modules/services/web-apps/immich.nix | 5 +++++ nixos/tests/web-apps/immich-public-proxy.nix | 3 +++ nixos/tests/web-apps/immich.nix | 3 +++ 3 files changed, 11 insertions(+) diff --git a/nixos/modules/services/web-apps/immich.nix b/nixos/modules/services/web-apps/immich.nix index a647b552678f..064122e06c53 100644 --- a/nixos/modules/services/web-apps/immich.nix +++ b/nixos/modules/services/web-apps/immich.nix @@ -228,6 +228,11 @@ in assertion = !isPostgresUnixSocket -> cfg.secretsFile != null; message = "A secrets file containing at least the database password must be provided when unix sockets are not used."; } + { + # When removing this assertion, please adjust the nixosTests accordingly. + assertion = cfg.database.enable -> lib.versionOlder config.services.postgresql.package.version "17"; + message = "Immich doesn't support PostgreSQL 17+, yet."; + } ]; services.postgresql = mkIf cfg.database.enable { diff --git a/nixos/tests/web-apps/immich-public-proxy.nix b/nixos/tests/web-apps/immich-public-proxy.nix index f711e56abb48..1516156223ce 100644 --- a/nixos/tests/web-apps/immich-public-proxy.nix +++ b/nixos/tests/web-apps/immich-public-proxy.nix @@ -30,6 +30,9 @@ port = 8002; settings.ipp.responseHeaders."X-NixOS" = "Rules"; }; + + # TODO: Remove when PostgreSQL 17 is supported. + services.postgresql.package = pkgs.postgresql_16; }; testScript = '' diff --git a/nixos/tests/web-apps/immich.nix b/nixos/tests/web-apps/immich.nix index 550a1630bda8..d716e50b8906 100644 --- a/nixos/tests/web-apps/immich.nix +++ b/nixos/tests/web-apps/immich.nix @@ -18,6 +18,9 @@ enable = true; environment.IMMICH_LOG_LEVEL = "verbose"; }; + + # TODO: Remove when PostgreSQL 17 is supported. + services.postgresql.package = pkgs.postgresql_16; }; testScript = ''