@@ -6,6 +6,9 @@ let
66 , glibc, zlib, readline, openssl, icu, systemd, libossp_uuid
77 , pkgconfig, libxml2, tzdata
88
9+ # This is important to obtain a version of `libpq` that does not depend on systemd.
10+ , enableSystemd ? (lib.versionAtLeast "9.6" version && !stdenv.isDarwin)
11+
912 # for postgreql.pkgs
1013 , this, self, newScope, buildEnv
1114
@@ -31,7 +34,7 @@ let
3134 buildInputs =
3235 [ zlib readline openssl libxml2 makeWrapper ]
3336 ++ lib.optionals icuEnabled [ icu ]
34− ++ lib.optionals (atLeast "9.6" && !stdenv.isDarwin) [ systemd ]
37+ ++ lib.optionals enableSystemd [ systemd ]
3538 ++ lib.optionals (!stdenv.isDarwin) [ libossp_uuid ];
3639
3740 nativeBuildInputs = lib.optionals icuEnabled [ pkgconfig ];
@@ -51,7 +54,7 @@ let
5154 "--sysconfdir=/etc"
5255 "--libdir=$(lib)/lib"
5356 "--with-system-tzdata=${tzdata}/share/zoneinfo"
54− (lib.optionalString (atLeast "9.6" && !stdenv.isDarwin) "--with-systemd")
57+ (lib.optionalString enableSystemd "--with-systemd")
5558 (if stdenv.isDarwin then "--with-uuid=e2fs" else "--with-ossp-uuid")
5659 ] ++ lib.optionals icuEnabled [ "--with-icu" ];
5760