Created: 2025-11-15 Last Updated: 2025-11-15 Stage: seedling
Isolated Development Environments
I’ve been experimenting with building isolated development environments. The idea is to separate all of my development resources from the resources installed and managed by my operating system. For example if I were building a Python project, my environment would install its own copy of Python, and install any packages relative to that copy of Python. This means that all of my projects are separate from each other, and separate from the operating system. If I upgrade a package or tool in one project, I don’t have to worry about it affecting any other project. Similarly, if I upgrade my operating system I don’t have to worry about any of my projects breaking.
Nix and Devbox
Nix is the package manager for NixOS. NixOS is a Linux distribution that specializes in building immutable, reproducible systems. Nix can be used with other distributions and even operating systems. Nix is notorius for being difficult to learn, as its configuration is managed through a functional language and the documentation isn’t the best. Devbox is a wrapper around Nix that simiplifies the process of building isolated development environments.
The Nix/Devbox combination is great, but has a couple of important limitations if you’re using it on a system other than NixOS. The first is your Nix environment won’t be able to run graphical applications. I discovered this while trying to work through a Pygame tutorial. I created a Devbox environment for Python and I was able to install all of my tools and the Pygame packages, but when I ran my program it wouldn’t display the the window. The Nix filesystem is very differet from a normal Linux distribution. This means that programs running in a Nix environment will look in different locations for shared libraries, in this case the core desktop libraries, and even if they are installed in the Nix environment they won’t be connected to the desktop running on the host operating system. The second limitation is Nix only works with packages within the Nix ecosystem. If you discover a new tool and it doesn’t already support a Nix package, you will most likely have to build your own before you start use it within your project.
I would like to try Devbox out on a system running NixOS and see if some of these limitations still apply.
Containers
In the past I’ve used containers to build isolated development environments. I am interested in revisiting this again within the context of using them with immutable Linux distributions like Fedora CoreOS or openSuse MicroOS. Containers offer similar levels of isolation, but potentially have issues interacting the host system too.