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.

Changed files
+11
nixos
modules
services
web-apps
tests
+5
nixos/modules/services/web-apps/immich.nix
···
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 {
+3
nixos/tests/web-apps/immich-public-proxy.nix
···
port = 8002;
settings.ipp.responseHeaders."X-NixOS" = "Rules";
};
+
+
# TODO: Remove when PostgreSQL 17 is supported.
+
services.postgresql.package = pkgs.postgresql_16;
};
testScript = ''
+3
nixos/tests/web-apps/immich.nix
···
enable = true;
environment.IMMICH_LOG_LEVEL = "verbose";
};
+
+
# TODO: Remove when PostgreSQL 17 is supported.
+
services.postgresql.package = pkgs.postgresql_16;
};
testScript = ''