Local Build
The mb CLI uses Nix flakes for reproducible builds, direnv for automatic environment setup, and a Makefile for common tasks.
Prerequisites
- Nix with flakes enabled — Install from nixos.org. Add
experimental-features = nix-command flakesto~/.config/nix/nix.conf. - direnv — Auto-loads the Nix dev shell when you enter the project directory.
# macOS
brew install direnv
# Add to ~/.zshrc or ~/.bashrc
eval "$(direnv hook zsh)" # or bash
Build
git clone https://github.com/papercomputeco/stereOS
cd stereos
# direnv auto-enters the Nix dev shell
direnv allow # first time only
make help # list targets
make build # build the binary
make test # run tests
For a production binary without the dev shell:
nix build
Output goes to ./result/bin/mb.
Runtime dependency
mb requires QEMU. On macOS it uses HVF; on Linux, KVM.
# macOS
brew install qemu
# Fedora / RHEL
sudo dnf install qemu-system-aarch64
# Ubuntu / Debian
sudo apt install qemu-system-arm
Testing
make test
Uses standard Go tests.
Troubleshooting
direnv not loading
Run direnv allow in the project directory. Check that the direnv hook is in your shell profile.
Nix build fails with network error
All dependencies are vendored. Run go mod vendor and check that vendor/ is up to date.