2.4. Experimental Nix flake

The repository contains an experimental Nix flake for reproducibly building the default TF-A configuration, which currently builds an AArch64 release for the FVP platform, and supports AArch64 and x86-64 hosts running Linux or macOS.

Note

The flake’s interface is preliminary and is likely to change.

2.4.1. Installing Nix

On Linux and macOS, a multi-user installation can be performed with the official installer:

curl -L https://nixos.org/nix/install | sh -s -- --daemon

Start a new shell after the installer finishes, then confirm that Nix is available:

nix --version

See the Nix download page for other installation methods and platform- specific instructions.

2.4.2. Enabling flakes

Enable the nix-command and flakes experimental features by adding the following line to ~/.config/nix/nix.conf:

experimental-features = nix-command flakes

The same setting can instead be added to /etc/nix/nix.conf for all users. To try the flake without changing either configuration file, pass the features on the command line:

nix build --extra-experimental-features "nix-command flakes"

2.4.3. Building TF-A

From the root of the TF-A repository, run:

nix build

On success, the result symbolic link should contain:

result/bl1.bin
result/bl2.bin
result/bl31.bin

2.4.4. Useful commands

The following commands inspect and validate the flake or format its Nix files:

nix flake show
nix flake check
nix fmt **/*.nix

Add --print-build-logs to nix build to display the complete build log.

Updating the pinned dependencies with nix flake update changes flake.lock and should be committed and reviewed like any other source change.

Some Git worktree configurations cannot currently be read by Nix’s Git implementation. If Nix reports an unsupported Git repository extension, use an explicit path flake reference:

nix build "path:${PWD}"

Copyright (c) 2026, Arm Limited. All rights reserved.