diff --git a/nixos/modules/services/web-apps/immich.nix b/nixos/modules/services/web-apps/immich.nix index 28e89709afde..86b29e657cd6 100644 --- a/nixos/modules/services/web-apps/immich.nix +++ b/nixos/modules/services/web-apps/immich.nix @@ -231,6 +231,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 = ''