Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postgresql: Make systemd support configurable #61581

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pkgs/servers/sql/postgresql/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ let
, glibc, zlib, readline, openssl, icu, systemd, libossp_uuid
, pkgconfig, libxml2, tzdata

# This is important to obtain a version of `libpq` that does not depend on systemd.
, enableSystemd ? (lib.versionAtLeast "9.6" version && !stdenv.isDarwin)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe also add an assert that systemd can't be null when enableSystemd = true. Though this is minor


# for postgreql.pkgs
, this, self, newScope, buildEnv

Expand All @@ -31,7 +34,7 @@ let
buildInputs =
[ zlib readline openssl libxml2 makeWrapper ]
++ lib.optionals icuEnabled [ icu ]
++ lib.optionals (atLeast "9.6" && !stdenv.isDarwin) [ systemd ]
++ lib.optionals enableSystemd [ systemd ]
++ lib.optionals (!stdenv.isDarwin) [ libossp_uuid ];

nativeBuildInputs = lib.optionals icuEnabled [ pkgconfig ];
Expand All @@ -51,7 +54,7 @@ let
"--sysconfdir=/etc"
"--libdir=$(lib)/lib"
"--with-system-tzdata=${tzdata}/share/zoneinfo"
(lib.optionalString (atLeast "9.6" && !stdenv.isDarwin) "--with-systemd")
(lib.optionalString enableSystemd "--with-systemd")
(if stdenv.isDarwin then "--with-uuid=e2fs" else "--with-ossp-uuid")
] ++ lib.optionals icuEnabled [ "--with-icu" ];

Expand Down