diff --git a/pkgs/servers/sql/postgresql/generic.nix b/pkgs/servers/sql/postgresql/generic.nix index b24140c438a20..bbc373ac9d382 100644 --- a/pkgs/servers/sql/postgresql/generic.nix +++ b/pkgs/servers/sql/postgresql/generic.nix @@ -7,7 +7,7 @@ let , pkg-config, libxml2, tzdata, libkrb5, substituteAll, darwin , linux-pam, bison, flex, perl, docbook_xml_dtd_45, docbook-xsl-nons, libxslt - , removeReferencesTo, writeShellApplication + , removeReferencesTo, writeShellScriptBin , systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemdLibs , gssSupport ? with stdenv.hostPlatform; !isWindows && !isStatic @@ -53,10 +53,7 @@ let else stdenv; - pg_config = writeShellApplication { - name = "pg_config"; - text = builtins.readFile ./pg_config.sh; - }; + pg_config = writeShellScriptBin "pg_config" (builtins.readFile ./pg_config.sh); in stdenv'.mkDerivation (finalAttrs: { inherit version; pname = pname + lib.optionalString jitSupport "-jit"; diff --git a/pkgs/servers/sql/postgresql/pg_config.sh b/pkgs/servers/sql/postgresql/pg_config.sh index 9538b213fb97a..d6293999a12dc 100644 --- a/pkgs/servers/sql/postgresql/pg_config.sh +++ b/pkgs/servers/sql/postgresql/pg_config.sh @@ -1,3 +1,5 @@ +set -euo pipefail + # The real pg_config needs to be in the same path as the "postgres" binary # to return proper paths. However, we want it in the -dev output to prevent # cyclic references and to prevent blowing up the runtime closure. Thus, we