From 807ef8f73434ce1c1cdcd21fe603356d1f3fd94e Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Mon, 20 Feb 2023 12:20:08 +0100 Subject: [PATCH] doc/hacking.md: Corrections and additions for cross --- doc/manual/src/contributing/hacking.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/manual/src/contributing/hacking.md b/doc/manual/src/contributing/hacking.md index f5c76f837..5c373c42b 100644 --- a/doc/manual/src/contributing/hacking.md +++ b/doc/manual/src/contributing/hacking.md @@ -110,7 +110,7 @@ $ nix-build You can also build Nix for one of the [supported target platforms](#target-platforms). -## Target platforms +## Platforms As specified in [`flake.nix`], Nix can be built for various platforms: @@ -122,14 +122,15 @@ As specified in [`flake.nix`], Nix can be built for various platforms: [`flake.nix`]: https://github.com/nixos/nix/blob/master/flake.nix In order to build Nix for a different platform than the one you're currently -one, you need to have some way for your system Nix to build code for that +on, you need to have some way for your system Nix to build code for that platform. Common solutions include [remote builders] and [binfmt emulation] (only supported on NixOS). [remote builders]: ../advanced-topics/distributed-builds.md [binfmt emulation]: https://nixos.org/manual/nixos/stable/options.html#opt-boot.binfmt.emulatedSystems -Once you are able to build for different platforms, executing the build is as simple as +These solutions let Nix perform builds as if you're on the native platform, so +executing the build is as simple as ```console $ nix build .#packages.aarch64-linux.default @@ -145,6 +146,8 @@ for classic Nix. You can use any of the other supported platforms in place of `aarch64-linux`. +Cross-compiled builds are available for ARMv6 and ARMv7, and Nix on unsupported platforms can be bootstrapped by adding more `crossSystems` in `flake.nix`. + ## Compilation environments Nix can be compiled using multiple environments: