Since this project touches OS-level concerns (Wayland, compositor, input injection, systemd, DBus, PipeWire), developing in a sandboxed environment is strongly recommended.
The most practical starting point. Develop everything inside a VM.
Host OS (e.g. Ubuntu)
↓
VM (NixOS)
↓
Wayland / Hyprland / KDE
↓
AI agent development
- Snapshot rollback — revert to a known good state when things break
- Compositor experiments — freely try Hyprland / KDE / Sway
- Input injection testing — ydotool, uinput, fake input are fragile; VM keeps it safe
- NixOS rebuild freely —
nixos-rebuild switchfailures are trivially recoverable
| VM | Notes |
|---|---|
| virt-manager + KVM | Best for Linux hosts |
| VMware | Stable GPU passthrough |
| VirtualBox | Easy but limited |
| Resource | Minimum | With local LLM |
|---|---|---|
| CPU | 6 cores | 6 cores |
| RAM | 8 GB | 16 GB |
| Disk | 60 GB | 60 GB |
| GPU | virtio | GPU passthrough preferred |
GPU acceleration is limited in VMs, which affects:
- PipeWire screen capture performance
- VLM inference speed
- Local LLM inference speed
This is acceptable for Phase 1 and Phase 2. GPU-dependent features should be validated on bare metal in Phase 3.
Once the agent is functional in the VM:
- Package the project as a Nix flake
- Install on the host Linux via
nix profile installornix run - Validate on the host desktop environment
For GPU-dependent features (PipeWire capture, VLM, local LLM), test on real hardware:
- Screen capture performance
- VLM inference latency
- End-to-end workflow timing
NixOS has built-in VM test infrastructure:
# Build a development VM
nix build .#nixosConfigurations.dev.vmIntegration tests can verify OS-level behavior:
testScript = ''
machine.wait_for_unit("agentd.service")
machine.succeed("nerva status")
'';This enables OS-level CI — automated testing of daemon startup, skill execution, and systemd integration.
For mature development:
dev VM → manual development and experimentation
test VM → automated CI tests for agent workflows
# Development build
cargo build
# Release build
cargo build --release
# Run tests
cargo test
# Run the daemon
cargo run --bin nervad
# Run the CLI
cargo run --bin nerva -- status