# direnv config — auto-activates ./.venv when entering this repo.
#
# Setup (once per laptop):
#   1. Install direnv:        nix-env -iA nixpkgs.direnv  (or your package manager)
#   2. Hook into your shell:  https://direnv.net/docs/hook.html
#   3. From the repo root:    direnv allow
#
# Bootstrap the venv first with ./scripts/setup-dev.sh — direnv only
# activates an existing venv, it does not create one.

if [ -d .venv ]; then
  export VIRTUAL_ENV="$PWD/.venv"
  PATH_add "$VIRTUAL_ENV/bin"
else
  echo "direnv: no .venv found. Run ./scripts/setup-dev.sh first." >&2
fi

# Project-local secrets / env overrides (gitignored). Optional.
[ -f .envrc.local ] && source_env .envrc.local
