NixOS on ARM: Difference between revisions

imported>Nerzhul
fix archlinux hint for cross compile
imported>Nerzhul
No edit summary
Line 464: Line 464:
If you are building on non-NixOS machine with QEMU binfmt wrapper configured, you will want to configure nix daemon to let it know that it can build for aarch64. Add the following line to <code>/etc/nix/nix.conf</code>:
If you are building on non-NixOS machine with QEMU binfmt wrapper configured, you will want to configure nix daemon to let it know that it can build for aarch64. Add the following line to <code>/etc/nix/nix.conf</code>:
<code>extra-platforms = aarch64-linux arm-linux</code>
<code>extra-platforms = aarch64-linux arm-linux</code>
{{note| archlinux users can install <code>extra/qemu-system-aarch64</code>, <code>aur/qemu-user-static</code> and <code>aur/binfmt-qemu-static</code>
{{note| archlinux users can install <code>extra/qemu-system-aarch64</code>, <code>extra/qemu-user-static</code> and <code>extra/binfmt-qemu-static</code>
and restart <code>systemd-binfmt.service</code>. Check if binfmt is loaded by <code>ls  /proc/sys/fs/binfmt_misc/</code> (there must be  <code>qemu-system-aarch64</code> or needed architecture) and add line <code><nowiki>extra-sandbox-paths = /usr/bin/qemu-system-aarch64</nowiki></code> to <code>/etc/nix/nix.conf</code>}}
and restart <code>systemd-binfmt.service</code>. Check if binfmt is loaded by <code>ls  /proc/sys/fs/binfmt_misc/</code> (there must be  <code>qemu-aarch64</code> or needed architecture) and add line <code><nowiki>extra-sandbox-paths = /usr/bin/qemu-aarch64</nowiki></code> to <code>/etc/nix/nix.conf</code>}}


If you want to build just one specific package, use this:
If you want to build just one specific package, use this: