Skip to content

Add Nix flake for reproducible builds and development#1910

Open
gburd wants to merge 1 commit intooxidecomputer:mainfrom
gburd:add-nix-flake
Open

Add Nix flake for reproducible builds and development#1910
gburd wants to merge 1 commit intooxidecomputer:mainfrom
gburd:add-nix-flake

Conversation

@gburd
Copy link
Copy Markdown

@gburd gburd commented Mar 18, 2026

Implements a comprehensive Nix flake that provides:

  • Reproducible development environment with exact Rust 1.90.0
  • Binary builds for all Crucible packages (downstairs, dsc, crutest, etc.)
  • Helper apps: start-downstairs, test-up, test-dsc, test-cluster
  • Docker images for single downstairs and test clusters
  • Multi-platform support (Linux/macOS, x86_64/aarch64)

Build approach uses stdenv.mkDerivation with cargo to handle complex Omicron git dependencies. Requires relaxed sandbox mode for network access during dependency fetching.

Usage:
nix develop # Enter dev shell
nix run .#start-downstairs -- -n 5 # Start 5 downstairs
nix build .#dsc --option sandbox relaxed

Configuration:
Add "sandbox = relaxed" to ~/.config/nix/nix.conf to avoid
typing --option sandbox relaxed on every command.

Files:

  • flake.nix: Main flake definition with packages, apps, devShell
  • flake.lock: Locked dependency versions
  • NIX_STATUS.md: Technical details and comparison of approaches
  • NIX_USAGE.md: Comprehensive usage guide
  • README.md: Updated with Nix usage section

Disclosure: This work was directed by the human committer but created by Claude Code.

Implements a comprehensive Nix flake that provides:

- Reproducible development environment with exact Rust 1.90.0
- Binary builds for all Crucible packages (downstairs, dsc, crutest, etc.)
- Helper apps: start-downstairs, test-up, test-dsc, test-cluster
- Docker images for single downstairs and test clusters
- Multi-platform support (Linux/macOS, x86_64/aarch64)

Build approach uses stdenv.mkDerivation with cargo to handle complex
Omicron git dependencies. Requires relaxed sandbox mode for network
access during dependency fetching.

Usage:
  nix develop                           # Enter dev shell
  nix run .#start-downstairs -- -n 5    # Start 5 downstairs
  nix build .#dsc --option sandbox relaxed

Configuration:
  Add "sandbox = relaxed" to ~/.config/nix/nix.conf to avoid
  typing --option sandbox relaxed on every command.

Files:
- flake.nix: Main flake definition with packages, apps, devShell
- flake.lock: Locked dependency versions
- NIX_STATUS.md: Technical details and comparison of approaches
- NIX_USAGE.md: Comprehensive usage guide
- README.md: Updated with Nix usage section
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant