Trying out Devenv
1/3/2025 tools
I’ve been trying out Devenv for a while now and I want to share my initial thoughts:
- Nixpkgs is great and there is almost everything you could want in it.
- Getting Elixir and Erlang though isn’t as straightforward, rather than being top-level packages, they are nested under “beam.packages” and you get them like so:
pkgs.beam.packages.erlang_27.elixir_1_18
. This gets Erlang 27 and Elixir 1.18. I don’t think it’s possible to specify a patch version. - Devenv also has a different syntax for languages. For example, to enable Bun, you would do:
languages.javascript.enable = true;
languages.javascript.bun.enable = true;
- When you run
devenv init
it uses a reposistory from Cachix. I’ve usually switch to nixpkgs-unstable. - Besides languages and packages to install, you can also specify environment variables, pre-commit hooks, test scripts, and more.
- The
direnv
integration is great. Any time you switch to a directory, everything is automatically activated. - I’m still not sure how I would use this in a team environment. Devenenv requeires a number of files and folder to be present, which would pollute the repository for those not using it.
Overall, I like Devenv. It’s a nice way to get started using Nix as a package manager without going all in on it. I don’t like that it has so many files. Compared to mise
or asdf
, which only has one. This makes it harder to use where the rest of the team doesn’t use Devenev.
On the other hand, for teams thay buy into Devenv, you have a declarative way to specify your development environment, and with Nix, it works everytime.
I think I will continue using Devenv for the time being in my own projects.