Skip to content
Closed
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions nixos/modules/services/databases/postgresql.nix
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ in
User = "postgres";
Group = "postgres";
PermissionsStartOnly = true;
Type = if lib.versionAtLeast cfg.package.version "9.6"
then "notify"
else "simple";

# Shut down Postgres using SIGINT ("Fast Shutdown mode"). See
# http://www.postgresql.org/docs/current/static/server-shutdown.html
Expand Down
5 changes: 4 additions & 1 deletion pkgs/servers/sql/postgresql/default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{ lib, stdenv, glibc, fetchurl, zlib, readline, libossp_uuid, openssl, libxml2, makeWrapper, tzdata }:
{ lib, stdenv, glibc, fetchurl, zlib, readline, libossp_uuid, openssl, libxml2, makeWrapper, tzdata, systemd }:

let

common = { version, sha256, psqlSchema }:
let atLeast = lib.versionAtLeast version; in stdenv.mkDerivation (rec {
name = "postgresql-${version}";
inherit version;

src = fetchurl {
url = "mirror://postgresql/source/v${version}/${name}.tar.bz2";
Expand All @@ -16,6 +17,7 @@ let

buildInputs =
[ zlib readline openssl libxml2 makeWrapper ]
++ lib.optionals (atLeast "9.6" && !stdenv.isDarwin) [ systemd ]
++ lib.optionals (!stdenv.isDarwin) [ libossp_uuid ];

enableParallelBuilding = true;
Expand All @@ -33,6 +35,7 @@ let
"--sysconfdir=/etc"
"--libdir=$(lib)/lib"
"--with-system-tzdata=${tzdata}/share/zoneinfo"
(lib.optionalString (atLeast "9.6" && !stdenv.isDarwin) "--with-systemd")
(if stdenv.isDarwin then "--with-uuid=e2fs" else "--with-ossp-uuid")
];

Expand Down