Hacker News new | ask | show | jobs
by lpmay 1846 days ago
Just a hint - extra attributes in the `mkShell` appear as environment variables in the built shell. So instead of a `shellHook` for this you can just have an attribute `ERL_LIBS="";`

I'm not completely sure but I think this approach is preferred because shellHook only runs in `nix-shell` but if you ever wanted to `nix-build` a release it might not run.

1 comments

There tools like direnv, that "enter" your env environment as soon as you cd to the directory. This is implemented by changing environment variables like PATH.

Because shellHook allows on executing any code, there's no standardized way to undo what it executes, so those tools don't execute that part.