Flawless and Reproducible Devshells with Nix Flakes and direnv
In my previous article about Nix, I explained why I gradually moved away from asdf and Mise in favor of Nix. Later on, we looked at how to manage secrets securely with sops-nix. Today, let’s tackle everyday developer friction: per-project development environments. We have all faced this classic situation: Project A requires Node 18 and a specific pnpm version. Project B runs on Node 22 with Python 3.12 and compiled C bindings. Project C demands Hugo extended, a Markdown linter, and a PostgreSQL client. The usual outcome? Version conflicts everywhere, forgotten nvm use calls, global installations cluttering your OS, or having to spin up heavy Docker/devcontainer setups just to run a linter or format code. ...