···488489 If you use this feature, updates to CoreDNS may require updating `vendorHash` by following these steps again.
49000491- `ffmpeg` default upgraded from `ffmpeg_5` to `ffmpeg_6`.
492493- `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).
···488489 If you use this feature, updates to CoreDNS may require updating `vendorHash` by following these steps again.
490491+- `postgresql_11` has been removed since it'll stop receiving fixes on November 9 2023.
492+493- `ffmpeg` default upgraded from `ffmpeg_5` to `ffmpeg_6`.
494495- `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).
···17To enable PostgreSQL, add the following to your {file}`configuration.nix`:
18```
19services.postgresql.enable = true;
20-services.postgresql.package = pkgs.postgresql_11;
21```
22-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.
2324<!--
25After running {command}`nixos-rebuild`, you can verify
···119120## Plugins {#module-services-postgres-plugins}
121122-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`:
123```ShellSession
124$ nix repl '<nixpkgs>'
125126Loading '<nixpkgs>'...
127Added 10574 variables.
128129-nix-repl> postgresql_11.pkgs.<TAB><TAB>
130-postgresql_11.pkgs.cstore_fdw postgresql_11.pkgs.pg_repack
131-postgresql_11.pkgs.pg_auto_failover postgresql_11.pkgs.pg_safeupdate
132-postgresql_11.pkgs.pg_bigm postgresql_11.pkgs.pg_similarity
133-postgresql_11.pkgs.pg_cron postgresql_11.pkgs.pg_topn
134-postgresql_11.pkgs.pg_hll postgresql_11.pkgs.pgjwt
135-postgresql_11.pkgs.pg_partman postgresql_11.pkgs.pgroonga
136...
137```
138139To add plugins via NixOS configuration, set `services.postgresql.extraPlugins`:
140```
141-services.postgresql.package = pkgs.postgresql_11;
142-services.postgresql.extraPlugins = with pkgs.postgresql_11.pkgs; [
143 pg_repack
144 postgis
145];
···148You 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:
149```
150self: super: {
151- postgresql_custom = self.postgresql_11.withPackages (ps: [
152 ps.pg_repack
153 ps.postgis
154 ]);
···158Here's a recipe on how to override a particular plugin through an overlay:
159```
160self: super: {
161- postgresql_11 = super.postgresql_11.override { this = self.postgresql_11; } // {
162- pkgs = super.postgresql_11.pkgs // {
163- pg_repack = super.postgresql_11.pkgs.pg_repack.overrideAttrs (_: {
164 name = "pg_repack-v20181024";
165 src = self.fetchzip {
166 url = "https://github.com/reorg/pg_repack/archive/923fa2f3c709a506e111cc963034bf2fd127aa00.tar.gz";
···17To enable PostgreSQL, add the following to your {file}`configuration.nix`:
18```
19services.postgresql.enable = true;
20+services.postgresql.package = pkgs.postgresql_15;
21```
22+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.
2324<!--
25After running {command}`nixos-rebuild`, you can verify
···119120## Plugins {#module-services-postgres-plugins}
121122+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`:
123```ShellSession
124$ nix repl '<nixpkgs>'
125126Loading '<nixpkgs>'...
127Added 10574 variables.
128129+nix-repl> postgresql_15.pkgs.<TAB><TAB>
130+postgresql_15.pkgs.cstore_fdw postgresql_15.pkgs.pg_repack
131+postgresql_15.pkgs.pg_auto_failover postgresql_15.pkgs.pg_safeupdate
132+postgresql_15.pkgs.pg_bigm postgresql_15.pkgs.pg_similarity
133+postgresql_15.pkgs.pg_cron postgresql_15.pkgs.pg_topn
134+postgresql_15.pkgs.pg_hll postgresql_15.pkgs.pgjwt
135+postgresql_15.pkgs.pg_partman postgresql_15.pkgs.pgroonga
136...
137```
138139To add plugins via NixOS configuration, set `services.postgresql.extraPlugins`:
140```
141+services.postgresql.package = pkgs.postgresql_12;
142+services.postgresql.extraPlugins = with pkgs.postgresql_12.pkgs; [
143 pg_repack
144 postgis
145];
···148You 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:
149```
150self: super: {
151+ postgresql_custom = self.postgresql_12.withPackages (ps: [
152 ps.pg_repack
153 ps.postgis
154 ]);
···158Here's a recipe on how to override a particular plugin through an overlay:
159```
160self: super: {
161+ postgresql_15 = super.postgresql_15.override { this = self.postgresql_15; } // {
162+ pkgs = super.postgresql_15.pkgs // {
163+ pg_repack = super.postgresql_15.pkgs.pg_repack.overrideAttrs (_: {
164 name = "pg_repack-v20181024";
165 src = self.fetchzip {
166 url = "https://github.com/reorg/pg_repack/archive/923fa2f3c709a506e111cc963034bf2fd127aa00.tar.gz";
+5-5
nixos/modules/services/databases/postgresql.nix
···5556 package = mkOption {
57 type = types.package;
58- example = literalExpression "pkgs.postgresql_11";
59 description = lib.mdDoc ''
60 PostgreSQL package to use.
61 '';
···78 dataDir = mkOption {
79 type = types.path;
80 defaultText = literalExpression ''"/var/lib/postgresql/''${config.services.postgresql.package.psqlSchema}"'';
81- example = "/var/lib/postgresql/11";
82 description = lib.mdDoc ''
83 The data directory for PostgreSQL. If left as the default value
84 this directory will automatically be created before the PostgreSQL server starts, otherwise
···387 extraPlugins = mkOption {
388 type = types.listOf types.path;
389 default = [];
390- example = literalExpression "with pkgs.postgresql_11.pkgs; [ postgis pg_repack ]";
391 description = lib.mdDoc ''
392 List of PostgreSQL plugins. PostgreSQL version for each plugin should
393 match version for `services.postgresql.package` value.
···399 default = {};
400 description = lib.mdDoc ''
401 PostgreSQL configuration. Refer to
402- <https://www.postgresql.org/docs/11/config-setting.html#CONFIG-SETTING-CONFIGURATION-FILE>
403 for an overview of `postgresql.conf`.
404405 ::: {.note}
···461 base = if versionAtLeast config.system.stateVersion "23.11" then pkgs.postgresql_15
462 else if versionAtLeast config.system.stateVersion "22.05" then pkgs.postgresql_14
463 else if versionAtLeast config.system.stateVersion "21.11" then pkgs.postgresql_13
464- else if versionAtLeast config.system.stateVersion "20.03" then pkgs.postgresql_11
465 else if versionAtLeast config.system.stateVersion "17.09" then mkThrow "9_6"
466 else mkThrow "9_5";
467 in
···5556 package = mkOption {
57 type = types.package;
58+ example = literalExpression "pkgs.postgresql_15";
59 description = lib.mdDoc ''
60 PostgreSQL package to use.
61 '';
···78 dataDir = mkOption {
79 type = types.path;
80 defaultText = literalExpression ''"/var/lib/postgresql/''${config.services.postgresql.package.psqlSchema}"'';
81+ example = "/var/lib/postgresql/15";
82 description = lib.mdDoc ''
83 The data directory for PostgreSQL. If left as the default value
84 this directory will automatically be created before the PostgreSQL server starts, otherwise
···387 extraPlugins = mkOption {
388 type = types.listOf types.path;
389 default = [];
390+ example = literalExpression "with pkgs.postgresql_15.pkgs; [ postgis pg_repack ]";
391 description = lib.mdDoc ''
392 List of PostgreSQL plugins. PostgreSQL version for each plugin should
393 match version for `services.postgresql.package` value.
···399 default = {};
400 description = lib.mdDoc ''
401 PostgreSQL configuration. Refer to
402+ <https://www.postgresql.org/docs/15/config-setting.html#CONFIG-SETTING-CONFIGURATION-FILE>
403 for an overview of `postgresql.conf`.
404405 ::: {.note}
···461 base = if versionAtLeast config.system.stateVersion "23.11" then pkgs.postgresql_15
462 else if versionAtLeast config.system.stateVersion "22.05" then pkgs.postgresql_14
463 else if versionAtLeast config.system.stateVersion "21.11" then pkgs.postgresql_13
464+ else if versionAtLeast config.system.stateVersion "20.03" then mkThrow "11"
465 else if versionAtLeast config.system.stateVersion "17.09" then mkThrow "9_6"
466 else mkThrow "9_5";
467 in
···22 version = "1.3.9";
23 hash = "sha256-64/dlm6e4flCxMQ8efsxfKSlja+Tko0zsghTgLatN+Y=";
24 };
25- "11" = {
26- version = "1.3.9";
27- hash = "sha256-8t/HhB/2Kjx4xMItmmKv3g9gba5VCBHdplYtYD/3UhA=";
28- };
29 }.${lib.versions.major postgresql.version} or (throw "Source for pg_hint_plan is not available for ${postgresql.version}");
30in
31stdenv.mkDerivation {
···22 version = "1.3.9";
23 hash = "sha256-64/dlm6e4flCxMQ8efsxfKSlja+Tko0zsghTgLatN+Y=";
24 };
000025 }.${lib.versions.major postgresql.version} or (throw "Source for pg_hint_plan is not available for ${postgresql.version}");
26in
27stdenv.mkDerivation {
-4
pkgs/servers/sql/postgresql/ext/pgaudit.nix
···22 version = "1.4.3";
23 hash = "sha256-c8/xUFIHalu2bMCs57DeylK0oW0VnQwmUCpdp+tYqk4=";
24 };
25- "11" = {
26- version = "1.3.4";
27- hash = "sha256-UEnwD36ejeYWyKRHZ4mPt6/Ru76Gy8s/rgIvmgermiM=";
28- };
29 }.${lib.versions.major postgresql.version} or (throw "Source for pgaudit is not available for ${postgresql.version}");
30in
31stdenv.mkDerivation {
···22 version = "1.4.3";
23 hash = "sha256-c8/xUFIHalu2bMCs57DeylK0oW0VnQwmUCpdp+tYqk4=";
24 };
000025 }.${lib.versions.major postgresql.version} or (throw "Source for pgaudit is not available for ${postgresql.version}");
26in
27stdenv.mkDerivation {