Toolbox is a self-contained, data-driven Nix package registry for turnkey. Each tool lives in packages/<name>/ as a data.json of pinned versions and a thin default.nix that hands that data to a builder in lib/. The root flake.nix assembles every package into a per-system registry. It also derives the flake package outputs, an eval-time registry check and a JSON manifest from that registry. The docs site under docs/ is generated from the manifest alone. The human-facing overview is README.md, and the contributor guide is AGENTS.md.
The root holds two source files: flake.nix and justfile.
- Inputs:
nix-pins(ownsnixpkgs),devenv,devenv-root(afile+file:///dev/nullplaceholder that callers override),teller, andpyproject-nix/uv2nix/pyproject-build-systems(used only bybuildUvApplication). nixConfigdeclares thefirefly-toolbox.cachix.orgsubstituter and its public key for downstream consumers.- Systems:
x86_64-linux,aarch64-linux,aarch64-darwin.x86_64-darwinis absent on purpose, because nixpkgs 26.11 dropped it. Some packagedata.jsonfiles still carryx86_64-darwinhashes, but no flake output builds them. - Outputs:
registry.<system>.<pkg>: the stamped{ versions; default; toolbox; }entry fromimport ./packages/<pkg> { pkgs, lib, toolbox, toolboxLib }, for every directory underpackages/.legacyPackages.<system>.<pkg>.<version_attr | default>: nested outputs (nix build .#go.1_25_6).packages.<system>: flat outputs (<pkg>-<version_attr>, and a bare<pkg>for the default). Both shapes come fromtoolboxLib.registryOutputs.checks.<system>.registry:toolboxLib.checkRegistry, which forces every advertised system.manifest:toolboxLib.registryManifestover all systems (nix eval --json .#manifest).overlays.default: a teller registry overlay.templates:default/devshell,goandrust.devShells.<system>.default: a devenv shell with toolbox's ownbeadwork,vcs-toolchain,justandnix. It also setslanguages.nix.enableandlanguages.python.enable.
toolboxis a lazy fixed point: packages reference each other through it (toolbox.go.versions.<v>), so the dependency graph between packages must stay acyclic.
- lib: ./lib/EGM.md.
toolboxLibholds the registry helpers (readData,buildPackage,buildToolchain,mkStamp,registryOutputs, …) and the per-shape builders (buildPrebuiltBinary,buildRustPackage,buildGoPackage,buildUvApplication,buildSkillBundle). It also defines thecheckRegistrygate and theregistryManifestserialiser. - packages: ./packages/EGM.md. 90 registry entries (70 packages, 14 toolchains, 6 skill bundles), each a
default.nixplus, usually, adata.json. - docs: ./docs/EGM.md. The
toolbox-docsPython generator. It turnsnix eval --json .#manifestinto the GitHub Pages site and never readspackages/*/data.json. - templates: ./templates/EGM.md. Downstream flake templates (
devshell,go,rust) that consumegithub:firefly-engineering/toolbox's public registry output.
- Reproducibility: every input is pinned by content hash (
sha256,vendorHash,cargoHash,npmDepsHash,pnpmDeps, lockfiles). No version range is resolved at build time, and upstream's own lockfile is preferred. - Every registry entry carries a
toolboxstamp withkindset topackage,toolchainorskill-bundle.buildPackage,buildToolchainandbuildSkillBundlestamp automatically. A hand-built entry (onlypackages/solana-toolchain) must callmkStamp. _meta.defaultmust be a version key. Abuilderfield must name a builder. Toolchain component pins and cross-package pins must resolve. Everypatches[].filemust exist.nix flake checkenforces all four throughcheckRegistry.- Platform availability is declared with
meta.platformsand filtered byavailableVersions. No package hand-builds its outputs to escape it. - Adding a builder variant never changes the derivations of existing versions. A refactor that preserves behaviour leaves every
drvPathunchanged. - The docs generator and the templates consume only published outputs (
.#manifest,registry), never package internals.
- Evaluation is offline, except
buildUvApplication's hash-pinnedbuiltins.fetchTarball(uv2nix readsuv.lockat eval time). - Builds fetch only through fixed-output derivations: GitHub archives, release assets, PyPI, npm/pnpm/cargo/Go dependency stores.
- CI (
.github/workflows/):check.ymlgatesnix flake check.cachix.ymlruns onx86_64-linuxonly, so it pushes no aarch64 builds. It runsnix-fast-build --skip-cachedwithaccept-flake-config = true, and builds and pushes what thefirefly-toolboxCachix cache is missing frompackages.<system>anddevShells.<system>.docs.ymlevaluates the manifest, runs the docs tests and publishesdocs/_site. justfilerecipesbuild-packages,build-devshell,push-packages,push-devshellandpushbuild every package and the dev shell, and push both to Cachix.
-
Run:
printf '%s' "$PWD" > .devenv-root nix flake check --impure --override-input devenv-root "file+file://$PWD/.devenv-root"
-
Per package:
nix build --no-link .#<pkg>.default. -
Docs:
pip install docs/[dev] && pytest docs/tests/ -v. -
Do not add
--all-systems. The check derivation is native, and the cross-system coverage comes from evaluation.