Skip to content

Commit

Permalink
postgresql: rename enableSystemd to systemdSupport for consistency
Browse files Browse the repository at this point in the history
We have gssSupport, jitSupport and pythonSupport - but enableSystemd?

Across nixpkgs there are currently three styles commonly used, about equally
often: withX, xSupport and enableX.

Let's at least use one consistent style in this package.
  • Loading branch information
wolfgangwalther committed Mar 15, 2024
1 parent d7ae1c5 commit e6bfabf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkgs/servers/sql/postgresql/generic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ let
, linux-pam

# This is important to obtain a version of `libpq` that does not depend on systemd.
, enableSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd && !stdenv.hostPlatform.isStatic
, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd && !stdenv.hostPlatform.isStatic
, enableSystemd ? null
, gssSupport ? with stdenv.hostPlatform; !isWindows && !isStatic

# for postgresql.pkgs
Expand Down Expand Up @@ -39,6 +40,8 @@ let
lz4Enabled = atLeast "14";
zstdEnabled = atLeast "15";

systemdSupport' = if enableSystemd == null then systemdSupport else (lib.warn "postgresql: argument enableSystemd is deprecated, please use systemdSupport instead." enableSystemd);

pname = "postgresql";

stdenv' = if jitSupport then llvmPackages.stdenv else stdenv;
Expand Down Expand Up @@ -66,7 +69,7 @@ let
++ lib.optionals jitSupport [ llvmPackages.llvm ]
++ lib.optionals lz4Enabled [ lz4 ]
++ lib.optionals zstdEnabled [ zstd ]
++ lib.optionals enableSystemd [ systemd ]
++ lib.optionals systemdSupport' [ systemd ]
++ lib.optionals pythonSupport [ python3 ]
++ lib.optionals gssSupport [ libkrb5 ]
++ lib.optionals stdenv'.isLinux [ linux-pam ]
Expand Down Expand Up @@ -97,7 +100,7 @@ let
"--libdir=$(lib)/lib"
"--with-system-tzdata=${tzdata}/share/zoneinfo"
"--enable-debug"
(lib.optionalString enableSystemd "--with-systemd")
(lib.optionalString systemdSupport' "--with-systemd")
(if stdenv'.isDarwin then "--with-uuid=e2fs" else "--with-ossp-uuid")
] ++ lib.optionals lz4Enabled [ "--with-lz4" ]
++ lib.optionals zstdEnabled [ "--with-zstd" ]
Expand Down

0 comments on commit e6bfabf

Please sign in to comment.