devenv 2.4: Machines

devenv 2.4 introduces Machines.

Define machine configurations alongside your development environment, then build and deploy them with devenv machines.

It supports:

You can contribute support for another OS to Machines.

SecretSpec can provide the credentials a new NixOS host needs on its first boot.

Machines are experimental, and we’d like feedback from people using it on real hosts.

From a development environment to a machine

For a NixOS server, add the disk and hardware detection inputs:

Then declare the machine in devenv.nix:

The imported NixOS module can define services, users, a bootloader, and a disk layout. devenv wires in disko and nixos-facter. On first install, it saves the host’s hardware report to .machines/server/facter.json. Commit that file so others and CI can build the configuration. See the disk layout example before installing.