postgresql: Fix use with extensions
Fixes #15512 and #16032 With the multi output, postgresql cannot find at runtime what is its basedir when looking for libdir and pkglibdir. This commit fixes that.
This commit is contained in:
@@ -11,12 +11,14 @@ let
|
||||
if cfg.extraPlugins == [] then pg
|
||||
else pkgs.buildEnv {
|
||||
name = "postgresql-and-plugins-${(builtins.parseDrvName pg.name).version}";
|
||||
paths = [ pg ] ++ cfg.extraPlugins;
|
||||
paths = [ pg pg.lib ] ++ cfg.extraPlugins;
|
||||
buildInputs = [ pkgs.makeWrapper ];
|
||||
postBuild =
|
||||
''
|
||||
mkdir -p $out/bin
|
||||
rm $out/bin/{pg_config,postgres,pg_ctl}
|
||||
cp --target-directory=$out/bin ${pg}/bin/{postgres,pg_config,pg_ctl}
|
||||
wrapProgram $out/bin/postgres --set NIX_PGLIBDIR $out/lib
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user