···488488489489 If you use this feature, updates to CoreDNS may require updating `vendorHash` by following these steps again.
490490491491+- `postgresql_11` has been removed since it'll stop receiving fixes on November 9 2023.
492492+491493- `ffmpeg` default upgraded from `ffmpeg_5` to `ffmpeg_6`.
492494493495- `fusuma` now enables the following plugins: [appmatcher](https://github.com/iberianpig/fusuma-plugin-appmatcher), [keypress](https://github.com/iberianpig/fusuma-plugin-keypress), [sendkey](https://github.com/iberianpig/fusuma-plugin-sendkey), [tap](https://github.com/iberianpig/fusuma-plugin-tap) and [wmctrl](https://github.com/iberianpig/fusuma-plugin-wmctrl).
···1717To enable PostgreSQL, add the following to your {file}`configuration.nix`:
1818```
1919services.postgresql.enable = true;
2020-services.postgresql.package = pkgs.postgresql_11;
2020+services.postgresql.package = pkgs.postgresql_15;
2121```
2222-Note that you are required to specify the desired version of PostgreSQL (e.g. `pkgs.postgresql_11`). Since upgrading your PostgreSQL version requires a database dump and reload (see below), NixOS cannot provide a default value for [](#opt-services.postgresql.package) such as the most recent release of PostgreSQL.
2222+Note that you are required to specify the desired version of PostgreSQL (e.g. `pkgs.postgresql_15`). Since upgrading your PostgreSQL version requires a database dump and reload (see below), NixOS cannot provide a default value for [](#opt-services.postgresql.package) such as the most recent release of PostgreSQL.
23232424<!--
2525After running {command}`nixos-rebuild`, you can verify
···119119120120## Plugins {#module-services-postgres-plugins}
121121122122-Plugins collection for each PostgreSQL version can be accessed with `.pkgs`. For example, for `pkgs.postgresql_11` package, its plugin collection is accessed by `pkgs.postgresql_11.pkgs`:
122122+Plugins collection for each PostgreSQL version can be accessed with `.pkgs`. For example, for `pkgs.postgresql_15` package, its plugin collection is accessed by `pkgs.postgresql_15.pkgs`:
123123```ShellSession
124124$ nix repl '<nixpkgs>'
125125126126Loading '<nixpkgs>'...
127127Added 10574 variables.
128128129129-nix-repl> postgresql_11.pkgs.<TAB><TAB>
130130-postgresql_11.pkgs.cstore_fdw postgresql_11.pkgs.pg_repack
131131-postgresql_11.pkgs.pg_auto_failover postgresql_11.pkgs.pg_safeupdate
132132-postgresql_11.pkgs.pg_bigm postgresql_11.pkgs.pg_similarity
133133-postgresql_11.pkgs.pg_cron postgresql_11.pkgs.pg_topn
134134-postgresql_11.pkgs.pg_hll postgresql_11.pkgs.pgjwt
135135-postgresql_11.pkgs.pg_partman postgresql_11.pkgs.pgroonga
129129+nix-repl> postgresql_15.pkgs.<TAB><TAB>
130130+postgresql_15.pkgs.cstore_fdw postgresql_15.pkgs.pg_repack
131131+postgresql_15.pkgs.pg_auto_failover postgresql_15.pkgs.pg_safeupdate
132132+postgresql_15.pkgs.pg_bigm postgresql_15.pkgs.pg_similarity
133133+postgresql_15.pkgs.pg_cron postgresql_15.pkgs.pg_topn
134134+postgresql_15.pkgs.pg_hll postgresql_15.pkgs.pgjwt
135135+postgresql_15.pkgs.pg_partman postgresql_15.pkgs.pgroonga
136136...
137137```
138138139139To add plugins via NixOS configuration, set `services.postgresql.extraPlugins`:
140140```
141141-services.postgresql.package = pkgs.postgresql_11;
142142-services.postgresql.extraPlugins = with pkgs.postgresql_11.pkgs; [
141141+services.postgresql.package = pkgs.postgresql_12;
142142+services.postgresql.extraPlugins = with pkgs.postgresql_12.pkgs; [
143143 pg_repack
144144 postgis
145145];
···148148You can build custom PostgreSQL-with-plugins (to be used outside of NixOS) using function `.withPackages`. For example, creating a custom PostgreSQL package in an overlay can look like:
149149```
150150self: super: {
151151- postgresql_custom = self.postgresql_11.withPackages (ps: [
151151+ postgresql_custom = self.postgresql_12.withPackages (ps: [
152152 ps.pg_repack
153153 ps.postgis
154154 ]);
···158158Here's a recipe on how to override a particular plugin through an overlay:
159159```
160160self: super: {
161161- postgresql_11 = super.postgresql_11.override { this = self.postgresql_11; } // {
162162- pkgs = super.postgresql_11.pkgs // {
163163- pg_repack = super.postgresql_11.pkgs.pg_repack.overrideAttrs (_: {
161161+ postgresql_15 = super.postgresql_15.override { this = self.postgresql_15; } // {
162162+ pkgs = super.postgresql_15.pkgs // {
163163+ pg_repack = super.postgresql_15.pkgs.pg_repack.overrideAttrs (_: {
164164 name = "pg_repack-v20181024";
165165 src = self.fetchzip {
166166 url = "https://github.com/reorg/pg_repack/archive/923fa2f3c709a506e111cc963034bf2fd127aa00.tar.gz";
+5-5
nixos/modules/services/databases/postgresql.nix
···55555656 package = mkOption {
5757 type = types.package;
5858- example = literalExpression "pkgs.postgresql_11";
5858+ example = literalExpression "pkgs.postgresql_15";
5959 description = lib.mdDoc ''
6060 PostgreSQL package to use.
6161 '';
···7878 dataDir = mkOption {
7979 type = types.path;
8080 defaultText = literalExpression ''"/var/lib/postgresql/''${config.services.postgresql.package.psqlSchema}"'';
8181- example = "/var/lib/postgresql/11";
8181+ example = "/var/lib/postgresql/15";
8282 description = lib.mdDoc ''
8383 The data directory for PostgreSQL. If left as the default value
8484 this directory will automatically be created before the PostgreSQL server starts, otherwise
···387387 extraPlugins = mkOption {
388388 type = types.listOf types.path;
389389 default = [];
390390- example = literalExpression "with pkgs.postgresql_11.pkgs; [ postgis pg_repack ]";
390390+ example = literalExpression "with pkgs.postgresql_15.pkgs; [ postgis pg_repack ]";
391391 description = lib.mdDoc ''
392392 List of PostgreSQL plugins. PostgreSQL version for each plugin should
393393 match version for `services.postgresql.package` value.
···399399 default = {};
400400 description = lib.mdDoc ''
401401 PostgreSQL configuration. Refer to
402402- <https://www.postgresql.org/docs/11/config-setting.html#CONFIG-SETTING-CONFIGURATION-FILE>
402402+ <https://www.postgresql.org/docs/15/config-setting.html#CONFIG-SETTING-CONFIGURATION-FILE>
403403 for an overview of `postgresql.conf`.
404404405405 ::: {.note}
···461461 base = if versionAtLeast config.system.stateVersion "23.11" then pkgs.postgresql_15
462462 else if versionAtLeast config.system.stateVersion "22.05" then pkgs.postgresql_14
463463 else if versionAtLeast config.system.stateVersion "21.11" then pkgs.postgresql_13
464464- else if versionAtLeast config.system.stateVersion "20.03" then pkgs.postgresql_11
464464+ else if versionAtLeast config.system.stateVersion "20.03" then mkThrow "11"
465465 else if versionAtLeast config.system.stateVersion "17.09" then mkThrow "9_6"
466466 else mkThrow "9_5";
467467 in
···2222 version = "1.3.9";
2323 hash = "sha256-64/dlm6e4flCxMQ8efsxfKSlja+Tko0zsghTgLatN+Y=";
2424 };
2525- "11" = {
2626- version = "1.3.9";
2727- hash = "sha256-8t/HhB/2Kjx4xMItmmKv3g9gba5VCBHdplYtYD/3UhA=";
2828- };
2925 }.${lib.versions.major postgresql.version} or (throw "Source for pg_hint_plan is not available for ${postgresql.version}");
3026in
3127stdenv.mkDerivation {
-4
pkgs/servers/sql/postgresql/ext/pgaudit.nix
···2222 version = "1.4.3";
2323 hash = "sha256-c8/xUFIHalu2bMCs57DeylK0oW0VnQwmUCpdp+tYqk4=";
2424 };
2525- "11" = {
2626- version = "1.3.4";
2727- hash = "sha256-UEnwD36ejeYWyKRHZ4mPt6/Ru76Gy8s/rgIvmgermiM=";
2828- };
2925 }.${lib.versions.major postgresql.version} or (throw "Source for pgaudit is not available for ${postgresql.version}");
3026in
3127stdenv.mkDerivation {