merge harden-devshell

hot-fix: pgdata anchored to repo root, .postgres/.direnv ignored
at any nesting. resolves stray backend/.postgres tracking caught
during phase 1 merge.
This commit is contained in:
Yisroel Baum 2026-05-06 14:58:44 +03:00
commit f47ea1c73d
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
2 changed files with 8 additions and 4 deletions

6
.gitignore vendored
View file

@ -1,9 +1,9 @@
# Nix devshell artefacts
/.postgres/
/.direnv/
.postgres/
.direnv/
result
result-*
# Process-compose state
/.pc.*
.pc.*
process-compose-*.log

View file

@ -27,7 +27,11 @@
];
shellHook = ''
export PGDATA="$PWD/.postgres"
# Anchor PGDATA to the repo root so subshells in subdirs
# (e.g. backend/) reuse the same cluster instead of seeding
# a stray .postgres there.
REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
export PGDATA="$REPO_ROOT/.postgres"
export PGHOST="$PGDATA"
export PGUSER="postgres"
export PGDATABASE="postgres"