From 01ce85f57231a3cf5fa9e82c56cd12e36cb2683a Mon Sep 17 00:00:00 2001 From: Alex Bates Date: Thu, 3 Sep 2026 19:55:16 +0100 Subject: [PATCH] store dev PDS data outside /tmp macOS periodically deletes files from /tmp that haven't been accessed in ~3 days. The @atproto/dev-env PDS stores actor signing keys as plain files, so after a few days without writes the key disappears and every putRecord fails with InternalServerError. Setting TMPDIR to ~/.local/share/starhaven-dev-pds before starting the PDS process causes os.tmpdir() to resolve there, putting all PDS data in a location macOS will not clean up. --- flake.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index db3af97..106faea 100644 --- a/flake.nix +++ b/flake.nix @@ -166,9 +166,11 @@ export STARHAVEN_DEV_PDS_BIN="${devPds}/bin/starhaven-dev-pds" # Local PDS + PLC directory runs in the background - dev_pds_pidfile=/tmp/starhaven-dev-pds.pid + dev_pds_dir="$HOME/.local/share/starhaven-dev-pds" + mkdir -p "$dev_pds_dir" + dev_pds_pidfile="$dev_pds_dir/pds.pid" if ! kill -0 "$(cat "$dev_pds_pidfile" 2>/dev/null)" 2>/dev/null; then - ${devPds}/bin/starhaven-dev-pds &> /tmp/starhaven-dev-pds.log 3>&- & + TMPDIR="$dev_pds_dir" ${devPds}/bin/starhaven-dev-pds &> "$dev_pds_dir/pds.log" 3>&- & echo $! > "$dev_pds_pidfile" disown fi -- 2.51.2