Apple Silicon's 16K pages mean FEX cannot run natively and qemu-user cannot run complex x86_64 binaries. Wire the maintained rowanG077/nix-x86-on-aarch64 runtime (FEX inside a 4K muvm microVM) into shoukei so games, Steam, Wine and other x86/x86_64 programs work, and let the module own the x86 ELF handlers instead of qemu-user. The input is pinned to our fork (ryan4yin/nix-x86-on-aarch64) at the reviewed commit. Dropping boot.binfmt.emulatedSystems also removes x86_64 from nix.settings.extra-platforms, so the qemu-user/uncached-x86-build gap is recorded as WA-022. - flake.nix: add nix-x86-on-aarch64 input (WA-021) - hosts/12kingdoms-shoukei/game/: programs.x86-on-arm + steam/wine, 6 GiB VM - hardware-configuration.nix: drop emulatedSystems/preferStaticEmulators - apple-silicon.nix: drop the now-redundant box64 - docs: WA-012 resolved; WA-021 and WA-022 added; host README updated
1.6 KiB
Host - Shoukei
This is NixOS's configuration for my Macbook Pro 2022 M2, 16G RAM.
This laptop joins untrusted networks and uses DHCP instead of a static IP, so it has no entry in
vars/networking.nix.
x86/x86_64 applications
The M2 uses 16 KiB pages, and FEX does not emulate 4 KiB guest pages, so x86/x86_64 binaries cannot
run directly on this kernel. game/ enables programs.x86-on-arm from
our fork of
rowanG077/nix-x86-on-aarch64, which runs FEX
inside a 4 KiB muvm microVM and registers both ELF handlers:
- run an x86/x86_64 ELF directly, or use
x86-arm run <program>; nix-shell -p x86pkgs.hello --run hellofor the x86 package set;steamandx86-arm-winefor games and Windows programs.
The microVM is capped at 6 GiB (memoryMiB) on this 16 GiB machine, and needs /dev/kvm plus a
running systemd user session. See WORKAROUNDS.md WA-021.
Because the host no longer registers qemu-user binfmt, podman run --platform=linux/amd64, x86
chroots, and local builds of uncached x86 derivations need a remote x86_64 builder (see
WORKAROUNDS.md WA-022).
Related: