devenv icon indicating copy to clipboard operation
devenv copied to clipboard

Replace direnv with Rust

Open domenkozar opened this issue 5 months ago • 3 comments

We're not using many features of direnv, and maintaining the long direnvrc in bash is tedious work.

Most importanty, it doesn't handle background processing of changes, which leads to poor DX.

We'd rebuild the environment in the background and then reload it if it succeeded, notifying the shell/TUI about it and say what changed.

domenkozar avatar Aug 01 '25 18:08 domenkozar

I have a related issue, I'm loading a devenv shell (defined via flake-parts) using direnv, but when running devenv up after making changes, it doesn't seem to reload the processes/tasks even though there is some nix evaluation happening. Most likely, it's inheriting ${DEVENV_TASKS} from the shell, but I would expect the devenv shim to replace it with fresh values if it's already evaluating the shell.

direnv reload resolves this issue

mrene avatar Aug 01 '25 22:08 mrene

This would be specially useful if editors like Zed would support devenv natively.

domenkozar avatar Aug 11 '25 19:08 domenkozar

I use this workaround: define a task that creates the .envrc and run devenv build at the same time. To generate the environment files, I have created this project: BigConfig but a Makefile will cut it too if you don't need tempating.

https://github.com/purcell/envrc/issues/119

amiorin avatar Oct 18 '25 05:10 amiorin