Nix GitHub Action for aarch64-darwin (i.e. Apple M1, M2) for populating a binary cache?

Hi folks,

We use Nix to build, cache and distribute the tooling at the organisation I work with.

However, most folk are using Apple M1 or M2 chips, and I’m struggling to find a nice solution for populating our Cachix cache with aarch64-darwin builds.

I first considered doing a deep refactor to try to enable cross-compilation from x86_64-darwin to aarch64-darwin, but then realized that the derivations would likely end up different anyway meaning M1 and M2 users would miss these cached builds.

At this point, I’m assuming the only way to go is to run a aarch64-darwin GitHub runner, but it looks like GitHub themselves don’t plan to launch ARM runners until Q4.

I’m curious what other folks are doing to populate their cache with aarch64-darwin builds under CI? Are there any services providing M1/M2 GitHub runners that you recommend? Or are you setting up your own M1/M2 GitHub runners using the self-hosted approach?

1 Like

The approach we took at Numtide is to self-host the Linux runner, and then set up a M1 as a Nix remote builder. We do this for a number of customers and it’s working pretty well. Thanks to the local disk cache, most of the noop runs are under 30s.

You can find the runner installation manual over here: GitHub Action Runner - SrvOS