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
2 changed files with 6 additions and 7 deletions

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.
'';
};