Tech News
← Back to articles

Show HN: Virby, a vfkit-based Linux builder for Nix-Darwin

read original related products more articles

Virby - Linux Builder for Nix-darwin

Virby is a module for nix-darwin that configures a lightweight, vfkit-based linux VM as a remote build machine for nix, allowing linux packages to be built on macOS. This project is modeled after nix-rosetta-builder, which provides a similar service, using lima to manage the VM. Some parts of the code in this repository are directly borrowed and adapted from that project.

Quick Start

Add to your flake and enable:

# flake.nix { inputs . virby = { url = "github:quinneden/virby-nix-darwin" ; inputs . nixpkgs . follows = "nixpkgs" ; } ; outputs = { virby , ... } : { darwinConfigurations . "myHost" = { modules = [ virby . darwinModules . default ] ; } ; } ; }

# configuration.nix services . virby = { enable = true ; cores = 8 ; memory = "6GiB" ; diskSize = "100GiB" ; } ;

Then rebuild: darwin-rebuild switch --flake .#myHost

Key Features

On-demand activation - VM starts only when builds are needed, shuts down after inactivity

- VM starts only when builds are needed, shuts down after inactivity Rosetta support - Build x86_64-linux packages on Apple Silicon using Rosetta translation

... continue reading