From 5b8072fff6afe5a455d06b8b8f37a6d7e0519986 Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Fri, 19 Aug 2016 09:06:40 +0200 Subject: 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. --- nixos/modules/services/databases/postgresql.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'nixos/modules') diff --git a/nixos/modules/services/databases/postgresql.nix b/nixos/modules/services/databases/postgresql.nix index 9988fc6e63be..24ef4637ec98 100644 --- a/nixos/modules/services/databases/postgresql.nix +++ b/nixos/modules/services/databases/postgresql.nix @@ -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 ''; }; -- cgit 1.4.1