# Dotfiles repo uses sibling worktree layout (legacy)
# Most repos use bare layout by default (see config/wt/config.toml)
export WORKTRUNK_WORKTREE_PATH="../{{ repo }}.{{ branch | sanitize }}"

# Beads: disable daemon in worktrees to avoid socket conflicts
export BEADS_NO_DAEMON=1

# Use the lightweight default flake shell for routine direnv loads.
# Set DOTFILES_DIRENV_MODE=full when you need deploy tooling or git hook setup.
# Set DOTFILES_DIRENV_MODE=light, or create .envrc.local exporting it, when a
# worktree only needs the cheap agent/worktree variables above and no Nix shell.
watch_file .envrc.local
source_env_if_exists .envrc.local

case "${DOTFILES_DIRENV_MODE:-default}" in
  default)
    use flake . --no-update-lock-file
    ;;
  full)
    use flake .#full --no-update-lock-file
    ;;
  light)
    ;;
  *)
    echo "dotfiles .envrc: unknown DOTFILES_DIRENV_MODE=${DOTFILES_DIRENV_MODE}; expected default, full, or light" >&2
    use flake
    ;;
esac
