Discovery helpers for building nbpr packages against the user's pinned Buildroot tree.
After mix deps.get, the user's project contains deps/nerves_system_br/
with everything we need to drive a per-package Buildroot build:
create-build.sh— pinsNERVES_BR_VERSION=<version>(e.g.2025.11.3)scripts/download-buildroot.sh— fetches the BR tarball from upstreampatches/buildroot/— Nerves-specific patches that must be applied before building anything against this BR tree (otherwise nbpr packages will build against an incompatible upstream BR and may fail at runtime)external.desc,external.mk,Config.in,package/— Nerves' BR external tree, exposing extra packages and thenervestoolchain hooks
This module reads what's needed from there. Actual build invocation lives in subsequent modules.
Summary
Functions
Reads the pinned NERVES_BR_VERSION from nerves_system_br's
create-build.sh. The returned string is the upstream Buildroot release
identifier, e.g. "2025.11.3".
Returns the absolute path to deps/nerves_system_br/ in the active Mix
project's deps tree, or {:error, :not_found} if it isn't a dep.
Returns the absolute path to nerves_system_br/ under deps_path, or
{:error, :not_found} if absent.
Lists the patch filenames (relative to patches_path/1) in the order
Buildroot's patch script expects them — sorted lexicographically, which
matches the leading numeric prefix convention (0001-..., 0002-...).
Returns the path to nerves_system_br's buildroot patch directory, or
{:error, :not_found} if absent. These patches must be applied to the
upstream BR tree before any build.
Functions
Reads the pinned NERVES_BR_VERSION from nerves_system_br's
create-build.sh. The returned string is the upstream Buildroot release
identifier, e.g. "2025.11.3".
@spec nerves_system_br_path() :: {:ok, Path.t()} | {:error, :not_found}
Returns the absolute path to deps/nerves_system_br/ in the active Mix
project's deps tree, or {:error, :not_found} if it isn't a dep.
Use nerves_system_br_path/1 when the lookup needs to span a different
Mix project (e.g. a generator running inside the :nbpr library that
needs to locate the workspace's nerves_system_br).
Returns the absolute path to nerves_system_br/ under deps_path, or
{:error, :not_found} if absent.
Lists the patch filenames (relative to patches_path/1) in the order
Buildroot's patch script expects them — sorted lexicographically, which
matches the leading numeric prefix convention (0001-..., 0002-...).
Returns the path to nerves_system_br's buildroot patch directory, or
{:error, :not_found} if absent. These patches must be applied to the
upstream BR tree before any build.