kosiew commented on code in PR #26122:
URL: https://github.com/apache/datafusion/pull/26122#discussion_r4215462851


##########
.envrc:
##########
@@ -1 +1,2 @@
 use flake
+source_env_if_exists .envrc.local

Review Comment:
   One optional improvement would be to guard `use flake` so contributors using 
direnv without Nix can still load `.envrc.local`. Since the local file is 
sourced afterward, it cannot prevent the current Nix error. We could use:
   
   ```bash
   if command -v nix >/dev/null 2>&1; then
     use flake
   fi
   source_env_if_exists .envrc.local
   ```
   
   This only checks whether Nix is available, so working flake integration is 
still required. This is a pre-existing limitation and not a blocker for this PR.



##########
docs/source/contributor-guide/development_environment.md:
##########
@@ -52,6 +52,16 @@ Notes:
 - `protoc` is required to compile DataFusion from source.
 - Some tests and examples rely on git submodule data being present locally.
 
+## Nix and direnv
+
+The repository's `flake.nix` provides a Nix development shell. Enter it 
directly
+with `nix develop`, or install and configure [direnv](https://direnv.net/) and 
run
+`direnv allow` from the repository root to load it automatically.
+
+Put machine-specific direnv settings in `.envrc.local`. This file is ignored by
+Git and loaded after the shared Nix environment so that local settings take

Review Comment:
   Could we add a short migration note for contributors who already have 
personal settings in `.envrc`? They should move those settings into 
`.envrc.local` rather than copying the entire shared file, which could 
duplicate `use flake`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to