LnL7 / nix-darwin

nix modules for darwin
MIT License
3.19k stars 457 forks source link

Is there a way to use the included linux-builder to build x86_64-linux using the rosetta? #1091

Open onnimonni opened 1 month ago

onnimonni commented 1 month ago

I learned in the nixos forums that the typical way to build x86_64-linux targets is to use UTM virtual machine and using virtualisation.rosetta.enable which then allows to use the rosetta binaries in the vm.

Can this same setup be achieved directly in the included linux builder nix.linux-builder.enable = true; so that I could build x86_64-linux targets from a apple silicon host?

Is there anything else better than the UTM vm?

Enzime commented 1 month ago

I believe nix.linux-builder.package = pkgs.linux-builder-x86_64; should work