Cached and Persistent Nix shell with direnv integration
Problem being solved
- the default
direnvNix integration from projects loads a Nix shell every new terminal or every time
default.nixchanges. On larger projects with a lot of Nix shell dependencies, that can cause the terminal to take more than 6 seconds to load, which significantly degrades the developer experience (DX).
- when a developer garbage collects in their Nix store, often the Nix shell dependencies are deleted also which causes a slow start the next time the project’s Nix shell is requested, also degrading developer experience (DX).
- on first Nix shell load, the Nix shell is evaluated fully such that direnv dumps the environment from the spawn Nix shell process