I want to build aarch64 packages using a remote builder.
I have a non-aarch64 machine baseline configured as a remote builder, meaning I can just run ssh builder nix-store --version.
The machine does not have NixOS installed but nix and nix-daemon running.
I am stuck with where to add boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; equivalent as I have no configuration.nix. Do I have to set up a qemu vm with NixOS inside ?
Checkout the config section of the binfmt.nix module in NixOS. It’ll give you an idea of how to implement the same functionality on a non-NixOS system.
Hi @ElvishJerricco, thanks for giving a good hint here, as far as I understand it, the remote builder running on arch linux I would have to install the binfmt packages provided in arch linux’ aur ?
Or do you mean implementing the config boot.* attribute in like home-manager, cause I’m using home-manager on that remote builder ?
Still lost somehow.
Edit: Found this as a further reference. If there is an alternative approach to try I’d be happy to contribute to it, especially the binfmt.nix based one for nix-only (but non-NixOS) setups.
Regarding my last comment describing just a special case where the remote isn’t necessarily a physically different one but running inside qemu.
In most other cases installing / configuring QEMU binfmt wrapper on the other hence remote machine should just work, see this comment on github as well. Bc we are talking about non-NixOS remotes you don’t even need the configuration.nix, qemu.nix and overlay changes mentioned there.
It does work for me but to be precise you’ll need Ubuntu 20.04+ (old qemu version are failing because of missing syscall) and in order for your builder process to access quemu you must set --option sandbox false