nix: put tmpdirs directly into /tmp to fix long unix socket paths
I'm not sure whether that's Lix specific, but when I enter nix-shell, I get quite a long TMPDIR, which results in all postgrest-with-pg-XX scripts failing, because the unix socket path is too long. If TMPDIR was not set, mktemp would fall back to /tmp, so we can just do that in any case, which guarantees a short path in every case.
This commit is contained in:
@@ -104,7 +104,7 @@ let
|
||||
''
|
||||
|
||||
+ lib.optionalString withTmpDir ''
|
||||
tmpdir="$(${coreutils}/bin/mktemp -d --tmpdir ${name}-XXX)"
|
||||
tmpdir="$(${coreutils}/bin/mktemp -d --tmpdir=/tmp ${name}-XXX)"
|
||||
|
||||
# we keep the tmpdir when an error occurs for debugging
|
||||
trap 'echo Temporary directory kept at: $tmpdir' ERR
|
||||
|
||||
Reference in New Issue
Block a user