mirror of
https://github.com/tree-sitter/tree-sitter.git
synced 2026-09-10 07:26:23 -04:00
nix: support single-checkout and multi-workspace direnv setups
The current `.envrc` unconditionally runs `use flake`, which breaks multi-workspace jj setups where workspace subdirectories each have their own `.envrc`. Entering a workspace unloads the root's nix env even when the workspace `.envrc` is blocked, because direnv always unloads the parent env on any `.envrc` transition. `source_up_if_exists` re-runs the parent `.envrc` and inherits its nix env in a multi-workspace setup (fast due to caching). The `IN_NIX_SHELL` guard then skips `use flake path:.`, which only runs in a plain single checkout where no parent `.envrc` exists and `IN_NIX_SHELL` is unset.
This commit is contained in:
parent
957ee4e634
commit
792bba8dab