rpi-provision Declarative first-boot provisioning for Raspberry Pi 5 SD cards Source on GitHub

0001. The workspace carries no external dependencies

Status: accepted

Context

rpi-provision reads a TOML specification, renders text files and writes them to a removable disk. The obvious dependency set would be serde, toml and clap, which together pull in roughly a dozen transitive crates including two proc-macro crates.

Three constraints pushed the other way:

  1. The tool writes to a device that someone will then trust with SSH keys and a Wi-Fi pre-shared key. The supply chain that produces the binary is part of that trust.
  2. It must be easy to build and distribute for Windows, Linux and both x86-64 and aarch64. Fewer moving parts means fewer cross-compilation surprises.
  3. The project convention is to pin dependencies to an exact version. Pinning a dozen transitive crates and keeping them current is real, recurring work for a tool whose problem domain barely changes.

Decision

The workspace depends on std and nothing else. Specifically, the following are implemented in-tree:

Component Crate Size
TOML subset parser rpi-provision-toml ~600 lines
SHA-256 rpi-provision-spec::sha256 ~120 lines
Line diff (LCS) rpi-provision-apply::diff ~150 lines
Argument parser rpi-provision::args ~180 lines

CI enforces this: a Cargo.lock containing any package that is not a workspace member fails the build.

Consequences

Accepted costs:

Benefits realised:

Alternatives considered

Revisit if

The specification format grows to need full TOML (date-times, mixed-type arrays), or the CLI grows subcommand hierarchies and shell completion. Neither is on the roadmap.