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.
This commit is contained in:
Wolfgang Walther 2025-06-22 12:45:10 +02:00
parent 43558d56a7
commit cb30307559
No known key found for this signature in database
GPG Key ID: B39893FA5F65CAE1
3 changed files with 11 additions and 0 deletions

View File

@ -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 {

View File

@ -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 = ''

View File

@ -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 = ''