Skip to content

Development Guide

This guide is for developers who want to contribute to Capsa. If you're looking to use Capsa in your own project, see Getting Started.

Setting Up the Development Environment

Capsa uses Nix with devenv for development. This ensures all contributors have identical toolchains and dependencies.

Installing Nix

We recommend Determinate Nix for the best installation experience:

bash
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install

Alternatively, use the official installer:

bash
curl -L https://nixos.org/nix/install | sh

Entering the Development Shell

bash
cd capsa
nix develop

Or if you have direnv installed, the environment loads automatically when you enter the directory.

This provides:

  • Rust toolchain with appropriate targets
  • Platform-specific tooling (codesign-run on macOS)
  • Test VM builders
  • Pre-configured cargo aliases

Cargo Aliases

The devenv sets up cargo aliases for common operations:

AliasDescription
cargo test-linuxRun tests with Linux KVM feature
cargo test-macosRun tests with macOS subprocess feature
cargo clippy-linuxRun clippy for Linux
cargo clippy-macosRun clippy for macOS

Feature Flags

FeatureDescription
linux-kvmEnables the Linux KVM backend
macos-subprocessEnables the macOS Virtualization.framework backend
test-utilsProvides test VM helpers for integration testing

Quick Reference

Released under the MIT License.