Devenv is Awesome!


Why devenv will change the way you think about developing software.
read in ~1 minute | Sep 24th 2024

I’m finding that I’m using devenv far more often in my projects, including my blog!

Devenv allows me to reliably build my projects across my Linux computers. I get to declare which command line tools the project expects. Once I’ve setup devenv, all my tools are in one spot. I don’t have to have everything for every project installed on my computers, I need to have nix and devenv.

Devenv is nix

If you are familiar with shell.nix, then you will be familiar with devenv. Devenv uses nix to create declarative shells, but with the bonus of hiding the complexity of nix flakes. Devenv uses nix flakes as a back-end, and if you run a Linux system that isn’t nix with flakes, you could greatly enjoy reproducible developer environments, specifically if you come back to projects years later.

Direnv is magic

Devenv is integrated with direnv, which can automatically activate your devenv when you enter your project folder. In short, cd project_folder and having all of the project specific tools there is awesome.

Jekyll Example

{ pkgs, lib, config, inputs, ... }:
{
  # https://devenv.sh/packages/
  packages = with pkgs; [
    git
    optipng
    jpegoptim
  ];
  # https://devenv.sh/languages/
  languages.ruby.enable = true;
  languages.ruby.version = "3.2";
}

The above example defines the environment I use for this blog. I use Jekyll which runs on ruby. I need ruby version 3.2 or greater, 3.1 doesn’t work anymore. And switching between theses is as easy as changing 3.2 to 3.1 and reloading the env.

Getting started

If you found this interesting, you can find everything I used to get started at devenv.sh/getting-started. There’s more to devenv than just getting software, but I’ll leave that for another day.


🪧 Enjoy Reading This?

Get notified of future posts by RSS!

Here are some more you might like to read next:


Keyd is Awesome!

Why keyd will change the way you think about your keyboard. Oct 20th 2024


Cosmic Desktop Environment is Awesome!

Why I'm excited even when daily driving it before release. Jul 24th 2024


Why NixOS is Awesome!

When did computing become scary? NixOS is here to the rescue! Jul 21st 2024



💬 Looking for comments?

I don't have comments on this site as they can be time consuming to manage. I'd rather concentrate on programming cool and new things.

Since you can't leave a comment, feel free to 📨 contact me instead.