postgresql: refactor to pass jitSupport/llvm via scope instead of passthru

This makes it less error-prone to use the llvm package in extensions, because
it will always match the package used by the postgresql derivation itself.

Previously, you could've accidentally used llvm instead of postgresql.llvm
with a different result.
This commit is contained in:
Wolfgang Walther 2024-03-02 14:04:06 +01:00
parent b301c01e31
commit 14b3ea2789
No known key found for this signature in database
GPG key ID: B39893FA5F65CAE1
5 changed files with 10 additions and 8 deletions

View file

@ -14,7 +14,7 @@ let
# package = pkgs.postgresql_<major>;
# };
# works.
base = if cfg.enableJIT && !cfg.package.jitSupport then cfg.package.withJIT else cfg.package;
base = if cfg.enableJIT then cfg.package.withJIT else cfg.package;
in
if cfg.extraPlugins == []
then base