0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-12 05:16:25 +03:00

nixos/postgresql: take extraPlugins packageset from package option

This allows to reuse the extraPlugins option in other context's for
example an upgrade script.
This commit is contained in:
Sandro Jäckel 2023-09-26 22:47:10 +02:00
parent d08d9057e4
commit 4fe5824fc7
No known key found for this signature in database
GPG key ID: 3AF5A43A3EECC2E5
2 changed files with 6 additions and 7 deletions

View file

@ -258,7 +258,7 @@ postgresql_15.pkgs.pg_partman postgresql_15.pkgs.pgroonga
To add plugins via NixOS configuration, set `services.postgresql.extraPlugins`:
```
services.postgresql.package = pkgs.postgresql_12;
services.postgresql.extraPlugins = with pkgs.postgresql_12.pkgs; [
services.postgresql.extraPlugins = ps: with ps; [
pg_repack
postgis
];

View file

@ -18,7 +18,7 @@ let
in
if cfg.extraPlugins == []
then base
else base.withPackages (_: cfg.extraPlugins);
else base.withPackages cfg.extraPlugins;
toStr = value:
if true == value then "yes"
@ -391,12 +391,11 @@ in
};
extraPlugins = mkOption {
type = types.listOf types.path;
default = [];
example = literalExpression "with pkgs.postgresql_15.pkgs; [ postgis pg_repack ]";
type = with types; coercedTo (listOf path) (path: _ignorePg: path) (functionTo (listOf path));
default = _: [];
example = literalExpression "ps: with ps; [ postgis pg_repack ]";
description = lib.mdDoc ''
List of PostgreSQL plugins. PostgreSQL version for each plugin should
match version for `services.postgresql.package` value.
List of PostgreSQL plugins.
'';
};