Direnv Integration
Answered
Direnv (https://direnv.net/) is a great tool for switching application, language and even tooling context within seconds. For example, it helps in having different java versions, in case you can't upgrade because of a bug or issue. Also, it allows using different sources for the setup. You can use it with nvm, sdkman, nix, etc.
Please sign in to leave a comment.
Hi Steffen. Thank you for your suggestion. What kind of integration do you mean here? Could you clarify the use-case? By the way, here is a related request:
FL-13867 Consider PATH-altering solutions (e.g. direnv, nix, poetry) when discovering available tools (e.g. cargo, pip)
Do you mean this kind of integration? Thanks.
Hey Andrey,
the PATH-altering solutions seem great. In my case, I am using `direnv` with `nix`, which means I have a `.envrc` file containing only the line `use nix` or `use flake` and that causes direnv to install/ load the programs I defined in the definitions.
For example, macOS comes with an older JVM (currently 18, if I'm not mistaken) installed. Using direnv my shell/ IDE should accept the direnv altered PATH to use the JVM, that I need (for example 21). This can be used for many things, like installing the Rust Tool chain, installing the NodeJS version I need for this project and even supporting ‘legacy’ versions of a language/ tool. There are a lot of different ways to use direnv, the most flexible I know of is devenv (https://devenv.sh/) using Nix and a bundled direnv version to start databases, local services and even complete setups you need for development.
Does this help to understand the benefits? Would love to help regarding testing/ working out solutions if needed.
Thank you for these clarifications a lot! Please vote and follow the issue in YouTrack. I have showed your feedback to the dev team. Thanks!