microvm.nix is a framework to run NixOS based micro VMs on various platforms. In particular, it can use vfkit to run micro VMs on macOS that use the macOS virtualization framework to provide a more performant VM than QEMU. microvm.nix works well but the documentation is a bit lacking. I had to figure out some gotchas while setting this up on my MacBook Pro M4, so I decided to write this note. This tutorial requires Nix and Nix Darwin to be installed on the macOS machine. To build a micro VM, we need a NixOS builder machine running AArch64 Linux. Thankfully, it is really easy to set up one with Nix Darwin. Assuming we have Nix Darwin set up with a Nix flake like: { inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-25.11-darwin"; nix-darwin = { url = "github:LnL7/nix-darwin"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = inputs@{ self, nixpkgs, nix-darwin, ... }: let system = "aarch64-darwin"; pkgs = import nixpkgs { inherit system; }; in {…
No comments yet. Log in to reply on the Fediverse. Comments will appear here.