b8c9db625415f76322c811868c2f9c056c15320e
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+https://git.oceanbox.io/oceanbox/claude-vm#claude-vm --impure
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;
claude-vm = (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
claudeuser, claude-code launches automatically
Exit
Press Ctrl-A X to quit QEMU.
Description
Languages
Nix
100%