If you’ve already got binfmt configured, then you just need some extra lines in nix.conf
. Here’s what NixOS generated for me w.r.t. that:
extra-platforms = aarch64-linux i686-linux
extra-sandbox-paths = /run/binfmt /nix/store/rkwxakv5hfzxh513kaa7mlypf402q9v8-qemu-aarch64-binfmt-P-x86_64-unknown-linux-musl
extra-platforms
tells it that we can build for those platforms, and extra-sandbox-paths
is necessary for the emulator to be usable inside the linux sandbox (since sandboxing should function roughly the same on other linux distributions as it does on nixos, meaning you’d need this)