Devenv: Fast, Declarative, Reproducible, and Composable Developer Environments

26 Likes

Hi @domenkozar ,

awesome! I just read a bit in your documentation (btw. I love it that you wrote it at the beginning of the project and that I don’t have to read through some source files to get an idea of how to use it!). But could you elaborate a bit more, as to what makes devenv different than say devShells in a flake? Thanks :slight_smile:

3 Likes

devenv is built on top of devShell.

What it offers is:

  • using NixOS modules to type validation, reusability and composition
  • higher-level abstractions such as specifying processes, pre-commit hooks, languages, scripts and more to come: dream2nix, editor config, etc.
  • documentation, each option is documented starting at Basics - devenv and with full reference
  • simplicity: I’ve spent a lot of time making interface simple to use so that any non-Nix user can start straight away. I understand this might not be appreciated as much by those knowing flakes, but it’s necessary for wider Nix adoption

I plan to write documentation how to use devenv with local flakes, as they are not exclusive.

I have quite a few ideas for what to build on top of devenv, but I need to get some rest before I create a roadmap.

One thing that was the goal of this project is: if we each developers to use modules for development environments, switching to nix-darwin/NixOS is very subtle.

I hope that answers your question, happy to go deeper into the details.

11 Likes

Thanks a lot! This does answer it.

I’ll especially gonna have a look at using modules inside a devshell. That sounds very promising :heart:

Looks awesome! Having something in the same line as homemanager and nixos for the shell is needed I think.

This does look similar to GitHub - numtide/devshell: Per project developer environments. How does it compare?

Edit: i see now how many languages are supported out of the box! That’s impressive. The processes is also a feature where devshell doesn’t have a good answer for yet.
How is the integration with direnv?

numtide/devshell and https://flake.parts/ both explored the idea of using nixos modules,
but I mostly focused on the design of the CLI UI and how it’s integrated via flakes to hide all the complexities away.

Most of the work really was writing documentation and explaining all pieces of using devenv - so that anyone can get started in an hour.

For direnv integration see Automatic Shell Activation - devenv

6 Likes
3 Likes

This is fun. Nice work @domenkozar :clap:

2 Likes

Idea for what’s missing in both:

  • first class support for hybrid local-remote developmemt service environments; the use cases are many.

The only tool , I’ve got to known, that explores this idea is probably: GitHub - ttacon/glorious

And then, ofc norouter.io

1 Like
4 Likes

Probably the biggest difference is that devenv’s documentation is actually friendly to people without Nix experience.

1 Like