Merge pull request #257503 from SuperSandro2000/postgres-extraPlugins

nixos/postgresql: take extraPlugins packageset from package option
This commit is contained in:
Robert Hensing 2023-12-08 21:51:05 +01:00 committed by GitHub
commit 47aff944e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 17 additions and 15 deletions

View File

@ -40,6 +40,9 @@ The pre-existing [services.ankisyncd](#opt-services.ankisyncd.enable) has been m
- Cinnamon has been updated to 6.0. Please beware that the [Wayland session](https://blog.linuxmint.com/?p=4591) is still experimental in this release.
- `services.postgresql.extraPlugins` changed its type from just a list of packages to also a function that returns such a list.
For example a config line like ``services.postgresql.extraPlugins = with pkgs.postgresql_11.pkgs; [ postgis ];`` is recommended to be changed to ``services.postgresql.extraPlugins = ps: with ps; [ postgis ];``;
- Programs written in [Nim](https://nim-lang.org/) are built with libraries selected by lockfiles.
The `nimPackages` and `nim2Packages` sets have been removed.
See https://nixos.org/manual/nixpkgs/unstable#nim for more information.

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

View File

@ -384,7 +384,7 @@ in
ensureDBOwnership = false;
}
];
extraPlugins = with postgresql.pkgs; [ postgis ];
extraPlugins = ps: with ps; [ postgis ];
};
# Nginx config taken from support/nginx/mobilizon-release.conf

View File

@ -11,7 +11,7 @@ with pkgs; {
{
services.postgresql = {
enable = true;
extraPlugins = [ pgjwt pgtap ];
extraPlugins = ps: with ps; [ pgjwt pgtap ];
};
};
};

View File

@ -9,10 +9,10 @@ import ./make-test-python.nix ({ pkgs, ...} : {
{ pkgs, ... }:
{
services.postgresql = let mypg = pkgs.postgresql; in {
services.postgresql = {
enable = true;
package = mypg;
extraPlugins = with mypg.pkgs; [
package = pkgs.postgresql;
extraPlugins = ps: with ps; [
postgis
];
};

View File

@ -27,7 +27,7 @@ let
services.postgresql = {
enable = true;
package = postgresql-package;
extraPlugins = with postgresql-package.pkgs; [
extraPlugins = ps: with ps; [
timescaledb
promscale_extension
];

View File

@ -52,7 +52,7 @@ let
services.postgresql = {
enable = true;
package = postgresql-package;
extraPlugins = with postgresql-package.pkgs; [
extraPlugins = ps: with ps; [
timescaledb
timescaledb_toolkit
];

View File

@ -11,7 +11,7 @@ import ./make-test-python.nix ({ pkgs, lib, ...} : {
{
services.postgresql = {
enable = true;
extraPlugins = with config.services.postgresql.package.pkgs; [
extraPlugins = ps: with ps; [
tsja
];
};