Files
claude-vm/README.md
T
2026-04-20 09:11:20 +02:00

1.6 KiB

Claude-VM

Shamelessly stole and refactored from https://github.com/solomon-b/claude-vm.

A headless QEMU VM with claude-code installed. Your current directory is mounted into the VM at /workspace.

Uses npins for dependency pinning and classic Nix (no flakes).

Usage

nix build -f . claude-vm
result/bin/claude-vm
result/bin/claude-vm --dangerously-skip-permissions
result/bin/claude-vm --model sonnet
result/bin/claude-vm -p "fix the tests"

or

nix run git+ssh://git@git.obx/oceanbox/claude-vm

All arguments are forwarded to claude-code inside the VM.

Home Manager (Npins)

To add claude-vm as a package in your home-manager configuration using npins:

# In your home-manager config directory
npins add git https://git.oceanbox.io/oceanbox/claude-vm -b main

Then reference it in your home.nix:

let
  sources = import ./npins;
  inherit (import sources.claude-vm { }) claude-vm;
in {
  home.packages = [ claude-vm ];
}

Development Shell

# First time setup
direnv allow

direnv watches shell.nix and rebuilds the environment automatically.

Updating Dependencies

npins update              # update all pins to latest
npins update nixpkgs      # update a single pin

What's Inside

  • NixOS VM: 4 gigabytes RAM, 4 cores, serial console
  • Packages: claude-code, git, curl, vim
  • 9p shared directory: host CWD mounted read-write at /workspace
  • Auto-login as claude user, claude-code launches automatically

Exit

Press Ctrl-A X to quit QEMU.