mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 19:55:41 +03:00
nixos/postgresql: fix enableJIT
Make sure that JIT is actually available when using services.postgresql = { enable = true; enableJIT = true; package = pkgs.postgresql_15; }; The current behavior is counter-intuitive because the docs state that `enableJIT = true;` is sufficient even though it wasn't in that case because the declared package doesn't have the LLVM dependency. Fixed by using `package.withJIT` if `enableJIT = true;` and `package.jitSupport` is `false`. Also updated the postgresql-jit test to test for that case.
This commit is contained in:
parent
a5a715bb24
commit
e2fb651752
2 changed files with 13 additions and 6 deletions
|
@ -7,9 +7,18 @@ let
|
|||
cfg = config.services.postgresql;
|
||||
|
||||
postgresql =
|
||||
let
|
||||
# ensure that
|
||||
# services.postgresql = {
|
||||
# enableJIT = true;
|
||||
# package = pkgs.postgresql_<major>;
|
||||
# };
|
||||
# works.
|
||||
base = if cfg.enableJIT && !cfg.package.jitSupport then cfg.package.withJIT else cfg.package;
|
||||
in
|
||||
if cfg.extraPlugins == []
|
||||
then cfg.package
|
||||
else cfg.package.withPackages (_: cfg.extraPlugins);
|
||||
then base
|
||||
else base.withPackages (_: cfg.extraPlugins);
|
||||
|
||||
toStr = value:
|
||||
if true == value then "yes"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue