postgresql: refactor to split up default.nix (2/2)

The recommended [1] structure for a package regarding versioning is to have each
version in a separate file. This commit just mechanically copies code around
without any changes.

Pure refactor, not changing any derivations.

[1]: pkgs/README.md
This commit is contained in:
Wolfgang Walther 2024-02-29 13:47:03 +01:00
parent 9af8c0a3b7
commit 1d9f2bd726
No known key found for this signature in database
GPG Key ID: B39893FA5F65CAE1
8 changed files with 75 additions and 58 deletions

View File

@ -0,0 +1,5 @@
import ./generic.nix {
version = "12.18";
psqlSchema = "12";
hash = "sha256-T5kZcl2UHOmGjgf+HtHTqGdIWZtIM4ZUdYOSi3TDkYo=";
}

View File

@ -0,0 +1,5 @@
import ./generic.nix {
version = "13.14";
psqlSchema = "13";
hash = "sha256-uN8HhVGJiWC9UA3F04oXfpkFN234H+fytmChQH+mpe0=";
}

View File

@ -0,0 +1,5 @@
import ./generic.nix {
version = "14.11";
psqlSchema = "14";
hash = "sha256-pnC9fc4i3K1Cl7JhE2s7HUoJpvVBcZViqhTKY78paKg=";
}

View File

@ -0,0 +1,5 @@
import ./generic.nix {
version = "15.6";
psqlSchema = "15";
hash = "sha256-hFUUbtnGnJOlfelUrq0DAsr60DXCskIXXWqh4X68svs=";
}

View File

@ -0,0 +1,5 @@
import ./generic.nix {
version = "16.2";
psqlSchema = "16";
hash = "sha256-RG6IKU28LJCFq0twYaZG+mBLS+wDUh1epnHC5a2bKVI=";
}

View File

@ -0,0 +1,43 @@
let
mkPackages = self: {
postgresql_12 = import ./12.nix {
this = self.postgresql_12;
thisAttr = "postgresql_12";
inherit self;
};
postgresql_13 = import ./13.nix {
this = self.postgresql_13;
thisAttr = "postgresql_13";
inherit self;
};
postgresql_14 = import ./14.nix {
this = self.postgresql_14;
thisAttr = "postgresql_14";
inherit self;
};
postgresql_15 = import ./15.nix {
this = self.postgresql_15;
thisAttr = "postgresql_15";
inherit self;
};
postgresql_16 = import ./16.nix {
this = self.postgresql_16;
thisAttr = "postgresql_16";
inherit self;
};
};
in self:
let packages = mkPackages self; in
packages
// self.lib.mapAttrs'
(attrName: postgres: self.lib.nameValuePair "${attrName}_jit" (postgres.override rec {
jitSupport = true;
thisAttr = "${attrName}_jit";
this = self.${thisAttr};
}))
packages

View File

@ -353,60 +353,9 @@ let
passthru.psqlSchema = postgresql.psqlSchema;
};
mkPackages = self: {
postgresql_12 = self.callPackage generic {
version = "12.18";
psqlSchema = "12";
hash = "sha256-T5kZcl2UHOmGjgf+HtHTqGdIWZtIM4ZUdYOSi3TDkYo=";
this = self.postgresql_12;
thisAttr = "postgresql_12";
inherit self;
};
postgresql_13 = self.callPackage generic {
version = "13.14";
psqlSchema = "13";
hash = "sha256-uN8HhVGJiWC9UA3F04oXfpkFN234H+fytmChQH+mpe0=";
this = self.postgresql_13;
thisAttr = "postgresql_13";
inherit self;
};
postgresql_14 = self.callPackage generic {
version = "14.11";
psqlSchema = "14";
hash = "sha256-pnC9fc4i3K1Cl7JhE2s7HUoJpvVBcZViqhTKY78paKg=";
this = self.postgresql_14;
thisAttr = "postgresql_14";
inherit self;
};
postgresql_15 = self.callPackage generic {
version = "15.6";
psqlSchema = "15";
hash = "sha256-hFUUbtnGnJOlfelUrq0DAsr60DXCskIXXWqh4X68svs=";
this = self.postgresql_15;
thisAttr = "postgresql_15";
inherit self;
};
postgresql_16 = self.callPackage generic {
version = "16.2";
psqlSchema = "16";
hash = "sha256-RG6IKU28LJCFq0twYaZG+mBLS+wDUh1epnHC5a2bKVI=";
this = self.postgresql_16;
thisAttr = "postgresql_16";
inherit self;
};
};
in self:
let packages = mkPackages self; in
packages
// self.lib.mapAttrs'
(attrName: postgres: self.lib.nameValuePair "${attrName}_jit" (postgres.override rec {
jitSupport = true;
thisAttr = "${attrName}_jit";
this = self.${thisAttr};
}))
packages
in
# passed by <major>.nix
versionArgs:
# passed by default.nix
{ self, ... } @defaultArgs:
self.callPackage generic (defaultArgs // versionArgs)

View File

@ -26735,7 +26735,7 @@ with pkgs;
timescaledb-tune = callPackage ../development/tools/database/timescaledb-tune { };
inherit (import ../servers/sql/postgresql/generic.nix pkgs)
inherit (import ../servers/sql/postgresql pkgs)
postgresql_12
postgresql_13
postgresql_14