NixOS module collection — NVIDIA JetPack SDK packaging for Jetson devices (fork of anduril/jetpack-nixos)

Qjp

Qjp

Version 1.00Source on GitHub

OVERVIEW

Qjp ("Qompass AI JetPack", repo description: "NixOS module for NVIDIA Jetson devices") packages components from NVIDIA's JetPack SDK for NixOS — platform firmware flashing scripts, NVIDIA's 5.10 kernel with nvgpu, EDK2-based UEFI firmware, ARM Trusted Firmware/OP-TEE, and packages for CUDA/CuDNN/TensorRT, V4L2/gstreamer multimedia, Wayland/GBM/EGL/Vulkan graphics, and nvpmodel/nvfancontrol power and fan control. It targets JetPack 5.1 devices: Jetson Orin AGX, Orin NX, Xavier AGX, and Xavier NX (Nano/TX2/TX1 are not supported).

HOW IT WORKS

  1. 1Put the Jetson in recovery mode (hold recovery, press reset), connect USB, and confirm with `lsusb | grep -i NVIDIA` showing an `NVIDIA Corp. APX` device.
  2. 2On an x86_64 host, build and run the flash script for your device, e.g. `nix build .#flash-xavier-agx-devkit` then `sudo ./result/bin/flash-xavier-agx-devkit` (use `nix flake show` to see options).
  3. 3Build the installer ISO with `nix build .#iso_minimal` and write it to USB with `dd`.
  4. 4Boot the Jetson from USB via the UEFI Boot Manager and follow the NixOS manual's UEFI installation.
  5. 5Include the module in your configuration with `hardware.nvidia-jetpack.enable = true;`, `hardware.nvidia-jetpack.som = "xavier-agx";`, and `hardware.nvidia-jetpack.carrierBoard = "devkit";` before installing.
  6. 6Later, update firmware from the device: check with `ota-check-firmware`, build a capsule (`nix build .#uefi-capsule-update-<device>`), copy it over, and apply with `sudo ota-apply-capsule-update example.Cap`.
How it works, step by step — each step as the project's own documentation states it.

CONCEPTS

FROM JETPACK SDK TO A RUNNING JETSONNVIDIA JETPACK SDK COMPONENTSJetPack 5.1 — firmware, kernel, CUDA stack (NVIDIA)QJP NIX PACKAGINGflake outputs: flash-* · iso_minimal · uefi-capsule-update-*FLASH TO DEVICEx86_64 host · device in recovery mode (APX over USB)EDK2 UEFI FIRMWAREARM Trusted Firmware · OP-TEE alongsideNVIDIA 5.10 KERNELnvgpu driverCUDA USERSPACECUDA · CuDNN · TensorRT · V4L2/gstreamer · Wayland/GBM/EGL/Vulkantarget set by hardware.nvidia-jetpack.som + carrierBoard — Orin AGX/NX, Xavier AGX/NX
The Qjp provisioning stack, top to bottom: NVIDIA's JetPack SDK components are packaged by the Nix flake, flashed to a device in recovery mode, and boot through EDK2 UEFI firmware into NVIDIA's 5.10 kernel with nvgpu, with the CUDA/TensorRT userland on top — every layer as the project's README, flake and modules name it.

CONFIGURATION

OptionDefaultWhat it does
enablefalse (mkEnableOption)Enable NVIDIA Jetson device support
somgenericSoM to target; enum: `generic`, `orin-agx`, `orin-agx-industrial`, `orin-nx`, `orin-nano`, `xavier-agx`, `xavier-agx-industrial`, `xavier-nx`, `xavier-nx-emmc`
carrierBoardgenericCarrier board to target; enum: `generic`, `devkit`
configureCudatrueInstantiate nixpkgs with `cudaSupport = true` and `cudaCapabilities` from the SoM (7.2 for Xavier, 8.7 for Orin)
modesetting.enablefalseEnable kernel modesetting (set true for Wayland, false for X11 per README)
maxClockfalseAlways run at maximum clock speed (enables the `jetson_clocks` oneshot service)
superfalseEnable "super mode" for Jetson Orin NX and Nano
kernel.realtimefalseEnable PREEMPT_RT patches (uses the RT kernel packages)
console.enableconfig.console.enableEnable the default console kernel parameters (tty0 + Tegra Combined UART)
firmware.autoUpdatefalse (mkEnableOption; README refers to it by its former name `bootloader.autoUpdate`)Automatic firmware updates after `nixos-rebuild switch` via UEFI capsule update
firmware.bootOrdernullDefault UEFI boot order (list over scsi/usb/sata/pxev4/httpv4/pxev6/httpv6/nvme/ufs/sd/emmc/cdrom/boot.img/virtual/shell)
firmware.uefi.debugModefalseEDK2/UEFI debug mode
firmware.optee.supplicant.enabletruetee-supplicant daemon for OP-TEE, with `extraArgs`, `trustedApplications`, `plugins` (all default `[ ]`)
services.nvpmodel.enable / profileNumberenabled by default when a config exists for the SoM / nullNVPModel power service; profileNumber selects a POWER_MODEL ID from the config file (null = the file's PM_CONFIG DEFAULT)
services.nvfancontrol.enableenabled by default on devkit carrier boardsFan control service, with per-SoM config file selected in devices.nix

CONTROLS

ActionControl
Verify recovery mode`lsusb \
List build optionsnix flake show
Build a flash script`nix build github:anduril/jetpack-nixos#flash-xavier-agx-devkit` (README form; this fork's flake generates the same `flash-<devkit>` attributes)
Flash UEFI firmwaresudo ./result/bin/flash-xavier-agx-devkit
Build the installer ISO`nix build github:anduril/jetpack-nixos#iso_minimal` (README form)
Write the ISO to USBsudo dd if=./result/iso/nixos-22.11pre-git-aarch64-linux.iso of=/dev/sdX bs=1M oflag=sync status=progress
Check firmware vs software versionota-check-firmware
Build a capsule updatenix build .#uefi-capsule-update-xavier-nx-emmc-devkit
Apply a capsule updatesudo ota-apply-capsule-update example.Cap` then `sudo reboot
Inspect capsule/slot statussudo nvbootctrl dump-slots-info

NOT COVERED

- The README is inherited from upstream `anduril/jetpack-nixos`: its commands reference `github:anduril/jetpack-nixos` and a `fetchTarball` of the anduril repo, not `qompassai/qjp`. The fork's own `flake.nix` does expose the same attribute names (`flash-*`, `iso_minimal`, `uefi-capsule-update-*` for orin-agx/orin-nx/orin-nano/xavier devkits), but no qjp-specific usage doc was found. - The README names the auto-update option `hardware.nvidia-jetpack.bootloader.autoUpdate`; in the current code that name is a renamed alias for `hardware.nvidia-jetpack.firmware.autoUpdate` (`modules/flash-script.nix`). - Orin Nano support is described in the README as future ("when the Orin Nano is released, it should be possible"), but the current `som` enum and flake hardware configs already include `orin-nano` — README and code disagree on vintage. - `kernel/`, `pkgs/`, `device-pkgs/`, and `anduril/` contents were not inventoried for this pack.

REFERENCES

  1. NVIDIA JetPack SDK documentationNVIDIA's canonical documentation for the JetPack SDK whose components Qjp packages for NixOS.
  2. jetpack-nixos — upstream projectThe upstream project Qjp forks; its flake exposes the same flash-*, iso_minimal and uefi-capsule-update-* attributes Qjp ships.