From 2112a50d802f3e2c4f1c0b82e285d713014413d5 Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Wed, 21 May 2025 13:26:53 +1200 Subject: [PATCH 1/2] Fix #2365 missing pg_config The `pg_config` executable was moved into its own derivation in `nixpkgs`. This fix includes that derivation if present when the `pg` library is requested. --- lib/system-nixpkgs-map.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/system-nixpkgs-map.nix b/lib/system-nixpkgs-map.nix index 53f31132f6..32cf325aa0 100644 --- a/lib/system-nixpkgs-map.nix +++ b/lib/system-nixpkgs-map.nix @@ -17,6 +17,7 @@ let lndir ${pkgs.buildPackages.gcc.cc} $out '') ] else []; + postgresqlLibs = [ postgresql ] ++ lib.optional (postgresql ? pg_config) postgresql.pg_config; in # -- linux { crypto = [ openssl ]; @@ -57,10 +58,10 @@ in bz2 = [ bzip2 ]; util = [ utillinux ]; magic = [ file ]; - pgcommon = [ postgresql ]; - pgport = [ postgresql] ; - pq = [ postgresql ]; - libpq = [ postgresql ]; + pgcommon = postgresqlLibs; + pgport = postgresqlLibs; + pq = postgresqlLibs; + libpq = postgresqlLibs; iconv = [ libiconv ]; lapack = [ liblapack ]; boost_atomic = [ boost ]; From 79d2b7b4f26befcbc61010bc9ca9df7044595904 Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Wed, 21 May 2025 14:41:11 +1200 Subject: [PATCH 2/2] Add comment --- lib/system-nixpkgs-map.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/system-nixpkgs-map.nix b/lib/system-nixpkgs-map.nix index 32cf325aa0..f979bfd0c1 100644 --- a/lib/system-nixpkgs-map.nix +++ b/lib/system-nixpkgs-map.nix @@ -17,6 +17,9 @@ let lndir ${pkgs.buildPackages.gcc.cc} $out '') ] else []; + # In newer versions of nixpkgs `pg_config` has been moved to its own derivation. + # Haskell libs that depend on the `pq` library (like `postgresql-libpq`) + # are likely to require `pg_config` to be in the `PATH` as well. postgresqlLibs = [ postgresql ] ++ lib.optional (postgresql ? pg_config) postgresql.pg_config; in # -- linux