Building from Source
Prerequisites#
- Go 1.25+ (the only hard requirement)
- Nix (optional, but provides the full dev environment)
Quick build#
git clone https://github.com/cpcloud/micasa.git
cd micasa
CGO_ENABLED=0 go build ./cmd/micasa
./micasa --demo
micasa uses a pure-Go SQLite driver, so CGO_ENABLED=0 works and produces a
fully static binary.
Nix dev shell#
The recommended development environment uses Nix flakes:
nix develop
This gives you:
gocompilergolangci-lint(static analysis)golines+gofumpt(formatting)osv-scanner(vulnerability scanning)hugo(docs site)vhs(terminal recording)git- Pre-commit hooks (auto-installed on first shell entry)
Everything is pinned to a consistent version. No system dependency surprises.
Build commands#
From within the dev shell (or with Go installed):
# Build the binary
go build ./cmd/micasa
# Run directly
go run ./cmd/micasa -- --demo
# Run tests
go test -shuffle=on -v ./...
Nix build#
To build the binary via Nix (reproducible, hermetic):
nix build
./result/bin/micasa --demo
Nix flake apps#
The flake exposes several convenience apps:
| Command | Description |
|---|---|
nix run | Run micasa directly |
nix run '.#website' | Serve the website locally with live reload |
nix run '.#docs' | Build the Hugo site into website/ |
nix run '.#record-demo' | Record the main demo GIF |
nix run '.#record-tape' | Record a single VHS tape to WebP |
nix run '.#record-animated' | Record all using-*.tape animated demos in parallel |
nix run '.#capture-one' | Capture a single VHS tape as a WebP screenshot |
nix run '.#capture-screenshots' | Capture all screenshot tapes in parallel |
nix run '.#pre-commit' | Run pre-commit hooks on all files |
nix run '.#deadcode' | Run whole-program dead code analysis |
nix run '.#osv-scanner' | Scan dependencies for known vulnerabilities |
Container image#
Build the OCI container image via Nix:
nix build '.#micasa-container'
docker load < result
docker run -it --rm micasa:latest --demo