nix(shell): remove postgrest/ directory prefix when running pg (#4502)

When running postgres from nix-shell, nix creates a directory
structure like `postgrest/postgrest-with-pg-17-XXX` in the `/tmp`
directory. This commit removes the extra `postgrest/` prefix to
shorten length of absolute path length of filenames.

Signed-off-by: Taimoor Zaeem <taimoorzaeem@gmail.com>
(cherry picked from commit 802cce9a28)
This commit is contained in:
Taimoor Zaeem
2025-11-26 08:33:23 +00:00
committed by Wolfgang Walther
parent 88538c1357
commit e429974f31
@@ -104,8 +104,7 @@ let
''
+ lib.optionalString withTmpDir ''
mkdir -p "''${TMPDIR:-/tmp}/postgrest"
tmpdir="$(${coreutils}/bin/mktemp -d --tmpdir postgrest/${name}-XXX)"
tmpdir="$(${coreutils}/bin/mktemp -d --tmpdir ${name}-XXX)"
# we keep the tmpdir when an error occurs for debugging
trap 'echo Temporary directory kept at: $tmpdir' ERR