···251251252252Technically, we'd not want to have EOL'ed packages in a stable NixOS release, which is to be supported until one month after the previous release. Thus, with NixOS' release schedule in May and November, the oldest PostgreSQL version in nixpkgs would have to be supported until December. It could be argued that a soon-to-be-EOL-ed version should thus be removed in May for the .05 release already. But since new security vulnerabilities are first disclosed in February of the following year, we agreed on keeping the oldest PostgreSQL major version around one more cycle in [#310580](https://github.com/NixOS/nixpkgs/pull/310580#discussion_r1597284693).
253253254254-Thus:
255255-- In September/October the new major version will be released and added to nixos-unstable.
254254+Thus, our release workflow is as follows:
255255+256256+- In May, `nixpkgs` packages the beta release for an upcoming major version. This is packaged for nixos-unstable only and will not be part of any stable NixOS release.
257257+- In September/October the new major version will be released, replacing the beta package in nixos-unstable.
256258- In November the last minor version for the oldest major will be released.
257259- Both the current stable .05 release and nixos-unstable should be updated to the latest minor that will usually be released in November.
258260 - This is relevant for people who need to use this major for as long as possible. In that case its desirable to be able to pin nixpkgs to a commit that still has it, at the latest minor available.
+28-13
nixos/modules/services/databases/postgresql.nix
···43434444 cfg = config.services.postgresql;
45454646- # ensure that
4747- # services.postgresql = {
4848- # enableJIT = true;
4949- # package = pkgs.postgresql_<major>;
5050- # };
5151- # works.
5252- basePackage = if cfg.enableJIT then cfg.package.withJIT else cfg.package.withoutJIT;
5353-5454- postgresql = if cfg.extensions == [ ] then basePackage else basePackage.withPackages cfg.extensions;
5555-5646 toStr =
5747 value:
5848 if true == value then
···7262 );
73637464 configFileCheck = pkgs.runCommand "postgresql-configfile-check" { } ''
7575- ${cfg.package}/bin/postgres -D${configFile} -C config_file >/dev/null
6565+ ${cfg.finalPackage}/bin/postgres -D${configFile} -C config_file >/dev/null
7666 touch $out
7767 '';
78687969 groupAccessAvailable = versionAtLeast cfg.finalPackage.version "11.0";
80708181- extensionNames = map getName postgresql.installedExtensions;
7171+ extensionNames = map getName cfg.finalPackage.installedExtensions;
8272 extensionInstalled = extension: elem extension extensionNames;
8373in
8474···143133 finalPackage = mkOption {
144134 type = types.package;
145135 readOnly = true;
146146- default = postgresql;
136136+ default =
137137+ let
138138+ # ensure that
139139+ # services.postgresql = {
140140+ # enableJIT = true;
141141+ # package = pkgs.postgresql_<major>;
142142+ # };
143143+ # works.
144144+ withJit = if cfg.enableJIT then cfg.package.withJIT else cfg.package.withoutJIT;
145145+ withJitAndPackages = if cfg.extensions == [ ] then withJit else withJit.withPackages cfg.extensions;
146146+ in
147147+ withJitAndPackages;
147148 defaultText = "with config.services.postgresql; package.withPackages extensions";
148149 description = ''
149150 The postgresql package that will effectively be used in the system.
···635636 ###### implementation
636637637638 config = mkIf cfg.enable {
639639+640640+ warnings = (
641641+ let
642642+ unstableState =
643643+ if lib.hasInfix "beta" cfg.package.version then
644644+ "in beta"
645645+ else if lib.hasInfix "rc" cfg.package.version then
646646+ "a release candidate"
647647+ else
648648+ null;
649649+ in
650650+ lib.optional (unstableState != null)
651651+ "PostgreSQL ${lib.versions.major cfg.package.version} is currently ${unstableState}, and is not advised for use in production environments."
652652+ );
638653639654 assertions = map (
640655 { name, ensureDBOwnership, ... }: