1self:
2let
3 # Before removing an EOL major version, make sure to check the versioning policy in:
4 # <nixpkgs>/nixos/modules/services/databases/postgresql.md
5 #
6 # Before removing, make sure to update it to the last minor version - and if only in
7 # an immediately preceding commit. This allows people relying on that old major version
8 # for a bit longer to still update up to this commit to at least get the latest minor
9 # version. In other words: Do not remove the second-to-last minor version from nixpkgs,
10 # yet. Update first.
11 versions = {
12 postgresql_12 = ./12.nix;
13 postgresql_13 = ./13.nix;
14 postgresql_14 = ./14.nix;
15 postgresql_15 = ./15.nix;
16 postgresql_16 = ./16.nix;
17 };
18
19 mkAttributes = jitSupport:
20 self.lib.mapAttrs' (version: path:
21 let
22 attrName = if jitSupport then "${version}_jit" else version;
23 in
24 self.lib.nameValuePair attrName (import path {
25 inherit jitSupport self;
26 })
27 ) versions;
28
29in
30# variations without and with JIT
31(mkAttributes false) // (mkAttributes true)