NixCon 2025

`nixos-compose`: Local development VMs made easy
2025-09-06 , Lecture Hall

When working on a software project, it can often be useful to spin up local development versions of services that run in production. This can be as simple as running a database to run your tests against, or as complicated as spinning up dozens of machines that talk to each other, while allowing you to observe and debug complex interactions. In some non-Nix projects, docker-compose is used for this successfully, but it requires a lot of manual configuration.

In projects where production machines are declared as NixOS configurations, the Nix ecosystem provides a lot of powerful building blocks for running VMs. But existing tools require a lot of manual configuration in order to run networks of VMs locally. They also have unintuitive interfaces and poor documentation, making it hard to use them (and, often, even to know about them!).

nixos-compose addresses these problems. It's a polished CLI tool that makes it remarkably easy to:

Start one or more VMs from a flake file,
SSH into them for debugging,
enable network communication between them, and
access VMs from the host.

In this talk, we’ll tour through the features and implementation of nixos-compose.

nixos-compose is an open-source tool built by garnix.

Sönke Hahn specializes in Functional Programming and has been using nix on and off since 2013. He also has a strong interest in Agile Software Engineering, from Test-Driven Development to team organization. He is the CTO of garnix.io.