nixpkgs/pkgs/servers/sql/postgresql/default.nix
Wolfgang Walther 8166a4ae06 postgresql: refactor attributes
There is no need to call the `withoutJIT` passthru explicitly here - the
default is without JIT anyway. This allows us to change the passthru to
work differently *without* affecting every `postgresql_xx` top-level
package.

(cherry picked from commit a0b09dd7a1)
2026-07-02 10:32:32 +00:00

40 lines
1.2 KiB
Nix

self:
let
# Before removing an EOL major version, make sure to check the versioning policy in:
# <nixpkgs>/nixos/modules/services/databases/postgresql.md
#
# Before removing, make sure to update it to the last minor version - and if only in
# an immediately preceding commit. This allows people relying on that old major version
# for a bit longer to still update up to this commit to at least get the latest minor
# version. In other words: Do not remove the second-to-last minor version from nixpkgs,
# yet. Update first.
versions = {
postgresql_14 = ./14.nix;
postgresql_15 = ./15.nix;
postgresql_16 = ./16.nix;
postgresql_17 = ./17.nix;
postgresql_18 = ./18.nix;
};
mkAttributes =
jitSupport:
self.lib.mapAttrs' (
version: path:
let
attrName = if jitSupport then "${version}_jit" else version;
postgresql = import path { inherit self; };
attrValue = if jitSupport then postgresql.withJIT else postgresql;
in
self.lib.nameValuePair attrName attrValue
) versions;
libpq = self.callPackage ./libpq.nix { };
in
{
# variations without and with JIT
postgresqlVersions = mkAttributes false;
postgresqlJitVersions = mkAttributes true;
inherit libpq;
}