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 (Intel & Apple Silicon)
brew install qemu
# Linux x86_64 (Fedora / RHEL)
sudo dnf install qemu-system-x86
# Linux x86_64 (Ubuntu / Debian)
sudo apt install qemu-system-x86
# Linux ARM64 (Fedora / RHEL)
sudo dnf install qemu-system-aarch64
# Linux ARM64 (Ubuntu / Debian)
sudo apt install qemu-system-arm
mb automatically selects the correct QEMU binary and configuration for your platform.
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.