Build
Building for Trezor Model One? See the legacy documentation.
Setup
Install Nix (provides the nix-shell command). All system dependencies are managed by it.
We use uv to manage Python dependencies. It is installed automatically inside nix-shell.
The recommended setup is to first enter nix-shell, then initialize the uv environment within it.
New Project
git clone --recurse-submodules https://github.com/trezor/trezor-firmware.git
cd trezor-firmware
nix-shell
uv sync
source .venv/bin/activate
Existing Project
git submodule update --init --recursive --force
nix-shell
uv sync
source .venv/bin/activate
After completing setup, see Emulator or Embedded build instructions.
Nix flakes
Flakes are experimental yet widely used feature of the Nix package manager. If you prefer you can use the associated tooling instead of nix-shell.
Classic nix-shell | Flakes equivalent |
|---|---|
nix-shell | nix develop |
nix-shell --run "uv run bash" | nix develop --command uv run bash |
nix-shell --arg fullDeps true --run "uv run make -C core test_emu" | nix develop .#everything -c uv run make -C core test_emu |
Note that as of 2026 flakes need to be enabled in nix.conf:
experimental-features = nix-command flakes