arduino-purifier full guide

Detailed setup, dependency management, build commands, and troubleshooting. Start with the overview for the initial commands; use the sections below for the complete setup and behavior. arduino-purifier is classified at maturity tier 4 (see tier assessment for details).

Contents

Setup and activation

Compile Arduino sketches with locked, Nix-resolved cores, tools, and libraries.

From a sketch with a pinned native sketch.yaml profile:

Use the overview’s Quickstart for the initial command sequence. The setup details below apply to that workflow.

Commit arduino-purifier.lock.json and arduino-purifier.indexes/ alongside sketch.yaml. The index directory preserves exact compressed, signed catalog snapshots when upstream index URLs change. Arduino CLI’s own profile parser, platform resolver, signed indexes, and installers select the artifacts for Linux x86-64 and ARM64. Nix verifies and replays those downloads before the lock is written.

A native profile declares the board and dependency versions, for example:

default_profile: uno
profiles:
  uno:
    fqbn: arduino:avr:uno
    platforms:
      - platform: arduino:avr (1.8.6)
    libraries:
      - ArduinoJson (7.4.3)

Version compatibility

Tool or language Packaged defaults Tested versions
Arduino CLI 1.5.1 —

Operating systems and architectures

OS CPU architecture Packaged toolchain Recorded workflow
Linux ARM64 Yes Not recorded
Linux x86-64 Yes Tested

Choosing versions

Component Selected by
Project compiler: Board toolchain The board profile and captured package index select the platform/compiler tool versions retained by the lock.
sketch.yaml, arduino-purifier.lock.json

Development loop

Keep editing your sketch and using native commands:

arduino-cli compile
arduino-cli compile --profile uno
arduino-cli upload --profile uno --port /dev/ttyACM0

The wrapper checks the dependency profile through Arduino’s native parser. Source edits, build properties, notes, and port settings do not require relocking. After changing dependency selections:

arduino-purifier lock --update
arduino-purifier prefetch

Using locked dependencies

The arduino-cli wrapper is required. It supplies readonly Nix profiles through private Arduino data, download, sketchbook, and build-cache directories. Existing global cores and libraries are preserved. Without a lockfile it warns and runs the ordinary, impure Arduino CLI. Install the wrapper through your usual installation method if you want it beyond nix shell.

--project and --lock select explicit locations; their environment equivalents are ARDUINO_PURIFIER_PROJECT and ARDUINO_PURIFIER_LOCK. The native wrapper also recognizes a sketch path passed to the command when no project is selected.

Working offline

Native dependency installation and removal direct you to the lock command. Project commands retain their ordinary network access. Private mutable state and Nix GC roots live beneath $XDG_CACHE_HOME/arduino-purifier.

Nix builds

Apply the overlay and use buildArduinoProject with src, doCheck, and checkCommand. Its result exposes packages, tests, release, and fetches, with output names known without import-from-derivation. The builder preserves the sketch directory name and compiles each locked profile.

Project projections

This integration provides native release artifacts, rather than a typed cross-purifier project projection interface. The publication workflow below uses those native artifacts.

arduino-purifier bundle creates firmware.tar.gz with native HEX and ELF files for each profile. publish --tag TAG uploads that exact archive to an existing GitHub release.

Supported scope

Scope

The initial provider supports pinned Arduino AVR profiles and registry libraries on Linux x86-64 and ARM64. It captures the native indexes, core, compiler, upload, discovery, monitor, and preprocessing tools. Source libraries, unpinned system platforms, other cores, and additional external runtimes need providers.

Nix patches the downloaded host executable loaders. Nixpkgs’ all-target GDB replaces the obsolete bundled AVR debugger; its provider and version are recorded in the environment metadata. Native installation metadata is normalized only to stabilize the order of tool definitions emitted from native Go maps.

Compilation and firmware inspection are tested without hardware. Physical uploads, monitoring, and on-device execution need your configured board.

Target systems

  • x86_64-linux
  • aarch64-linux

Platform limitations and validation

  • Native Linux x86-64 and ARM64 CI passed firmware compilation, frozen dependency guards, cold capture, immutable index replay, firmware consumption and reproducible builds.
  • Physical uploads, monitoring and on-device execution are not exercised by the fixture.