How does your builder differs from nix-darwin/modules/nix/linux-builder.nix at e04a388232d9a6ba56967ce5b53a8a6f713cdfcf · nix-darwin/nix-darwin · GitHub ?
It differs in many ways. Most importantly:
- The Linux builder in Nixpkgs needs to be manually started and stopped and you need to provide proper configuration for it in your
nix.conf
. The nix-darwin module does make it easier but it’s still something that it’d be tricky to get an entire team or org up and running with. With Determinate Nix, the configuration is handled for you and there’s no manual starting/stopping of any VM. You could trivially have 100 engineers on macOS laptops building Linux stuff in minutes. - Determinate Nix uses some pretty straightforward Swift code to interact with macOS’s native Virtualization framework, which runs builds in lightweight VMs, whereas the Nixpkgs Linux builder runs a full-fledged NixOS VM.
The Linux builder in Nixpkgs is great and I’ve used it a ton personally. But we wanted to take the usability story to a qualitatively different level and I think we’ve achieved that.
A couple other things:
- It uses virtio for the filesystem, so there is absolutely no copying to a remote builder. That also means there is no GC that needs to run, or long running remote process with its own state that needs management.
- It doesn’t require SSH keys, configuring IPs, managing a machines file, etc. It’s just … there! Ready to work.
Awesome! When do we expect this to be ready?
Also, any plans to make this available in nix-darwin without determinate nix? Asking because Nix Darwin is not fully compatible with Determinate Nix per the documentation here: GitHub - nix-darwin/nix-darwin: Manage your macOS using Nix
It’s ready now and we’re going to begin rolling it out to users, as described in the post.
And Determinate Nix is definitely compatible with nix-darwin! GitHub - DeterminateSystems/determinate: Determinate is Nix for the enterprise. An end-to-end experience of using Nix, from installation to collaboration to deployment.
To answer your question, it’s not clear to me how this functionality could be moved out of Determinate Nix.
You might want to have a look at GitHub - cpick/nix-rosetta-builder (can automatically start and stop Linux builder on demand, also supports Rosetta for x86_64-linux builds) or GitHub - quinneden/virby-nix-darwin: A vfkit-based linux builder for Nix-darwin (similar to nix-rosetta-builder but based on vfkit/Virtualization.framework instead of lima/qemu)
Good stuff! Does this work with non-Flakes Nix derivations, e.g. nix-build -A someLinuxDerivation ?