direnv
Hacker ApprovedThe most recommended of 5 dev environment managers
Developers recommend direnv for loading per-project environment variables and tools automatically when entering a directory, especially alongside Nix flakes. One critic reports it slows shells.
Developers recommend direnv for loading per-project environment variables and tools automatically when entering a directory, especially alongside Nix flakes. One critic reports it slows shells.
37 people gave an opinion
- recommend it
- 34
- criticize it
- 3
- approval share
- 92%
Recommended in 10 of 13 months
- November 2025: recommended
- December 2025: recommended
- January 2026: recommended
- February 2026: not recommended
- March 2026: recommended
- April 2026: recommended
- May 2026: recommended
- June 2026: recommended
- July 2026: not recommended
- August 2026: recommended
- September 2026: recommended
- October 2026: recommended
- November 2026: not recommended (month in progress)
Why it carries the badge
- 34 people recommend itNeeds 10 or more, met.
- 11 recommenders for every criticNeeds 2 to 1 or better, met.
- Recommended in 10 of 13 monthsNeeds 4 or more, met.
The same three rules apply to every product, and the badge can’t be bought. How the badge works
What people say about it
The reasons people give, with the number of comments that give each one. Open a reason to read what they said.
Why people recommend it
Each mark is one comment
Works well with Nix flakes
“the integration of flakes/devshells and direnv is great to create reproducible development environments”
Comment from 29 Jun 2026 in “NixOS 26.05 Released” “I personally use direnv with nix to have per-project dependency versions installed automatically”
Comment from 8 Aug 2026 in “The Nixpkgs core team has disbanded” “This makes the only system dependencies for a great dev environment nix and direnv.”
Comment from 29 Jun 2026 in “NixOS 26.05 Released” - Comment from 28 Nov 2025 in “Installing Java in 2025, and Version Managers”
- Comment from 3 Apr 2026 in “Show HN: Home Maker: Declare Your Dev Tools in a Makefile”
- Comment from 29 Jun 2026 in “NixOS 26.05 Released”
- Comment from 17 Aug 2026 in “We Are Forking dotenvy into dotenv-ng”
- Comment from 25 Sep 2026 in “Dutch governments builds alternative for Microsoft based on NixOS”
Loads environment automatically per directory
“I've been personally relying more on direnv to automatically activate certain shell configurations”
Comment from 17 Jun 2026 in “Bringing down my ZSH load times from ~3.1s to ~230ms” “if you're using long-running shells then direnv can load and unload env vars”
Comment from 17 Aug 2026 in “We Are Forking dotenvy into dotenv-ng” “direnv is great for switching any envnvariables let given directory.”
Comment from 28 Nov 2025 in “Installing Java in 2025, and Version Managers” - Comment from 19 May 2026 in “CISA Admin Leaked AWS GovCloud Keys on GitHub”
- Comment from 11 Oct 2026 in “I paid people to try and follow my README”
- Comment from 30 Dec 2025 in “Go Away Python”
Simple, stable, does one thing well
“It does everything I want, nothing I don't, and has been stable for me for years.”
Comment from 17 Aug 2026 in “We Are Forking dotenvy into dotenv-ng” “I show this to people as there's so little friction to using it.”
Comment from 22 Jan 2026 in “Show HN: Dotenv Mask Editor: No more embarrassing screen leaks of your .env” “Direnv is the right way to go if you want a tool for this.”
Comment from 17 Aug 2026 in “We Are Forking dotenvy into dotenv-ng” - Comment from 17 Aug 2026 in “We Are Forking dotenvy into dotenv-ng”
Keeps secrets out of .envrc
“Everything that isn't secret just lives in .envrc and gets loaded by direnv”
Comment from 23 May 2026 in “Ask HN: How do small teams securely share env files?” “This solves the problem of plain-text files”
Comment from 28 Nov 2025 in “GitLab discovers widespread NPM supply chain attack” “source_env_if_exists .envrc.local”
Comment from 23 Sep 2026 in “Two Git ignore files nobody told me about”
Other dev environment managers people recommend
The four most recommended other dev environment managers, with the same counts for each, so you can compare like for like. The tick on each bar marks the 2 to 1 line the badge needs.
| Product | Recommend | Criticize | Approval | Months | Owned | Badge |
|---|---|---|---|---|---|---|
| direnvThis page | 34 | 3 | 92% | 10 | — | Approved |
| devenv | 26 | 2 | 93% | 11 | — | Approved |
| Devbox by Jetify | 10 | 1 | 91% | 5 | — | Approved |
| Coasts | 8 | 0 | 100% | 2 | — | — |
| Flox | 7 | 3 | 70% | 5 | — | — |
What people said
39 of the 40 comments that mention it, newest first. Each links to the original comment.
“I've torched entire weekends trying to get the same workflow out of direnv and pamac/homebrew.”
“Install direnv, enter the project repo, and `direnv allow`”
“it has already fully replaced brew, stow and direnv”
“one can use direnv, nix-direnv and flake.nix”
“source_env_if_exists .envrc.local”
“Incredible combo for development.”
“if you're using long-running shells then direnv can load and unload env vars”
“direnv does one thing really well”
“you actually have real environment variables”
“Direnv is the right way to go if you want a tool for this.”
“It does everything I want, nothing I don't, and has been stable for me for years.”
“Direnv's first stable release was in 2013, .env was 2012 (adopted by Heroku).”
“direnv + nix flakes solved so many problems for me”
“Am I weird or old-fashioned for relying on direnv over .env?”
“I personally use direnv with nix to have per-project dependency versions installed automatically”
“It has none of the problems posited in the OP's article.”
“You setup a flake.nix in your code repo along with direnv”
“This makes the only system dependencies for a great dev environment nix and direnv.”
“the integration of flakes/devshells and direnv is great to create reproducible development environments”
“you don't need to build your own lightsaber with direnv and nix”
“In my experience direnv is also a source of slowness”
“I've been personally relying more on direnv to automatically activate certain shell configurations”
“Would pair well with direnv to set the right keys per project.”
“Everything that isn't secret just lives in .envrc and gets loaded by direnv”
“that's just N=mod(hash based on the worktree name) and then port=default_port+N”
“you can use tools like direnv to make them available to your shell”
“integration with direnv to activate it”
“adding flake.nix+direnv on a per project basis is just magical”
“direnv, .envrc, "layout uv"”
“I show this to people as there's so little friction to using it.”
“it's direnv support is great”
“I appreciate that Zed works smoothly with Nix and Direnv, even through remote projects.”
“things like direnv and mise make that disappear”
“Less overall to think about if you bind the two states together.”
“Then you can do e.g. use other persons python scripts without modifying their shebang.”
“in my projects (with direnv)”
“This solves the problem of plain-text files”
“There's nothing like direnv + nix + a flake with the appropriate dev shell config”
“direnv is great for switching any envnvariables let given directory.”
Counts come from 1,795,640 Hacker News comments, November 2025 to November 2026. How we count. Report a mistake.