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:
commit
f47ea1c73d
2 changed files with 8 additions and 4 deletions
6
.gitignore
vendored
6
.gitignore
vendored
|
|
@ -1,9 +1,9 @@
|
|||
# Nix devshell artefacts
|
||||
/.postgres/
|
||||
/.direnv/
|
||||
.postgres/
|
||||
.direnv/
|
||||
result
|
||||
result-*
|
||||
|
||||
# Process-compose state
|
||||
/.pc.*
|
||||
.pc.*
|
||||
process-compose-*.log
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue