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:
@@ -258,7 +258,7 @@ postgresql_15.pkgs.pg_partman postgresql_15.pkgs.pgroonga
|
|||||||
To add plugins via NixOS configuration, set `services.postgresql.extraPlugins`:
|
To add plugins via NixOS configuration, set `services.postgresql.extraPlugins`:
|
||||||
```
|
```
|
||||||
services.postgresql.package = pkgs.postgresql_12;
|
services.postgresql.package = pkgs.postgresql_12;
|
||||||
services.postgresql.extraPlugins = with pkgs.postgresql_12.pkgs; [
|
services.postgresql.extraPlugins = ps: with ps; [
|
||||||
pg_repack
|
pg_repack
|
||||||
postgis
|
postgis
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ let
|
|||||||
in
|
in
|
||||||
if cfg.extraPlugins == []
|
if cfg.extraPlugins == []
|
||||||
then base
|
then base
|
||||||
else base.withPackages (_: cfg.extraPlugins);
|
else base.withPackages cfg.extraPlugins;
|
||||||
|
|
||||||
toStr = value:
|
toStr = value:
|
||||||
if true == value then "yes"
|
if true == value then "yes"
|
||||||
@@ -391,12 +391,11 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
extraPlugins = mkOption {
|
extraPlugins = mkOption {
|
||||||
type = types.listOf types.path;
|
type = with types; coercedTo (listOf path) (path: _ignorePg: path) (functionTo (listOf path));
|
||||||
default = [];
|
default = _: [];
|
||||||
example = literalExpression "with pkgs.postgresql_15.pkgs; [ postgis pg_repack ]";
|
example = literalExpression "ps: with ps; [ postgis pg_repack ]";
|
||||||
description = lib.mdDoc ''
|
description = lib.mdDoc ''
|
||||||
List of PostgreSQL plugins. PostgreSQL version for each plugin should
|
List of PostgreSQL plugins.
|
||||||
match version for `services.postgresql.package` value.
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user