NixOS on ARM: Difference between revisions

imported>Wizeman
No edit summary
imported>MarSoft
Crosscompiling: building on non-nixos x86_64 machine
Line 304: Line 304:


It is also possible to crosscompile aarch64 on your local machine or a remote builder by registering  QEMU as a binfmt wrapper for the aarch64 architecture. This wrapper uses emulation and will therefore be slower than comparable native machines. A [https://github.com/cleverca22/nixos-configs/blob/master/qemu.nix module] and and [https://github.com/cleverca22/nixos-configs/tree/master/overlays/qemu overlay] are provided by user '''@clever'''.
It is also possible to crosscompile aarch64 on your local machine or a remote builder by registering  QEMU as a binfmt wrapper for the aarch64 architecture. This wrapper uses emulation and will therefore be slower than comparable native machines. A [https://github.com/cleverca22/nixos-configs/blob/master/qemu.nix module] and and [https://github.com/cleverca22/nixos-configs/tree/master/overlays/qemu overlay] are provided by user '''@clever'''.
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>
If you want to build just one specific package, use this:
<syntaxHighlight lang=nix>
nix-build '<nixpkgs/nixos>' -A pkgs.theRequiredPackage --argstr system aarch64-linux -I nixos-config=/path/to/target/machine/nixos/config/copy
</syntaxHighlight>
(the last option should not be required on NixOS machines)


== Board-specific installation notes ==
== Board-specific installation notes ==