Skip to content

Linux on macOS — building and testing Nix flake outputs ​

How to realize {aarch64,x86_64}-linux Nix derivations on an Apple-silicon Mac, and how to run the working-tree command ci --test for those systems — not merely download a Linux ELF into /nix/store.

The sparkles flake already declares Linux outputs: inputs.systems is nix-systems/triplet, i.e. ["aarch64-darwin" "aarch64-linux" "x86_64-linux"]. GitHub Actions already runs ci --test on ubuntu-latest (x86_64-linux) and ubuntu-24.04-arm (aarch64-linux). This tree is about doing the same from the laptop.

Last reviewed: September 4, 2026

This survey answers six questions:

  1. What is the difference between substituting a Linux store path, building one, and executing one — and how is a dev shell entered with no builder? → concepts
  2. What does Determinate Nix's native Linux builder actually do, and why does a configured host still get HTTP 400? → determinate-linux-builder
  3. How does Apple container run a Linux userspace, including linux/amd64 via Rosetta? → apple-container
  4. What is the Virtualization.framework package underneath it? → apple-containerization
  5. How does the older nix-darwin / nixpkgs Linux builder compare, and what is the open-source external-builders peer? → nix-darwin-linux-builder
  6. What should sparkles use today? → sparkles-baseline + recommendations

Master catalog ​

SubjectWhat it isRuns Linux ELFs?Builds missing Linux drvs?Link
Conceptssubstitute vs build vs execute; store bind-mount——concepts.md
Determinate native Linux builderexternal-builders → determinate-nixd builder (VZ)derivations onlyyes, if the feature is ondeterminate-linux-builder.md
Apple containerOCI CLI; one lightweight VM per containeryesnot by itselfapple-container.md
Apple ContainerizationSwift package: VZ + vminitd + Rosetta for linux/amd64yes (as a library)not by itselfapple-containerization.md
nix-darwin linux-builderpersistent NixOS VM, SSH remote builderderivations onlyyes, once the VM is upnix-darwin-linux-builder.md
Comparisoncapability matrix——comparison.md
sparkles baselinewhat this machine and this flake do todayobservedobservedsparkles-baseline.md
Recommendationsthe dispatcher ci --host-system——recommendations.md

Taxonomy ​

By Nix integration ​

IntegrationMechanismSubjects
external-builders JSON protocolNix execs a helper with a build.json; the helper runs the drv in a VMDeterminate, IOHK nix-linux-builder
SSH builders = @/etc/nix/machinesclassical remote buildernix-darwin linux-builder
None (execute only)bind-mount /nix/store into a Linux VM and exec an already-realized ELFApple container

By who provides the Linux kernel ​

Kernel sourceSubjects
Determinate-shipped guestDeterminate native builder
Apple container system kernelApple container / Containerization
NixOS guest imagenix-darwin linux-builder, linux-builder-vz
IOHK prebuilt guest-kernelnix-linux-builder

Milestones ​

DateWhat landed
2022nixpkgs darwin.linux-builder (QEMU NixOS VM, SSH on port 31022)
2025-05-28DeterminateSystems/nix-src#78 — external-builders experimental feature
2025-08-05Determinate Nix 3.8.4 blog: native Linux builder for macOS (developer preview)
2025-06-09Apple container / Containerization public repos
2026-05-06IOHK nix-linux-builder v0.3.0 — same external-builders protocol, ungated
2026-09-04This survey: Determinate builder configured but gated; Apple container 1.1.0 runs ci --test inside the reconstructed devShells.ci

Suggested reading ​

Sources ​