From 974f45c00154e6649b216ba636bebb335a994eab Mon Sep 17 00:00:00 2001 From: Ethan Date: Tue, 10 Mar 2026 22:36:02 -0700 Subject: [PATCH] fix: remove claude-code from nix set, increase VM disk to 20GB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two fixes for the "No space left on device" error during nixos-rebuild: 1. Remove claude-code from ai-code nix set — the nixpkgs package bundles sharp/libvips (~500MB) and is redundant since we already install the latest version via npm in install_latest_claude_code(). This eliminates the duplicate install. 2. Increase default VM disk from 10GB to 20GB on both Incus and Lima. NixOS with dev tools needs more space than the default allows. Co-Authored-By: Claude Opus 4.6 --- nix/sets/ai-code.nix | 3 ++- src/runtime/incus.rs | 8 ++++++++ src/runtime/lima.rs | 1 + src/sandbox/provision.rs | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/nix/sets/ai-code.nix b/nix/sets/ai-code.nix index af61bab..7b99f0d 100644 --- a/nix/sets/ai-code.nix +++ b/nix/sets/ai-code.nix @@ -3,8 +3,9 @@ # Uses tryEval with meta.license check to handle both missing and unfree packages. { pkgs }: let + # claude-code is installed separately via npm (latest version, smaller footprint) + # — the nixpkgs package bundles sharp/libvips (~500MB) and lags behind releases. wanted = [ - "claude-code" "codex" "opencode" "aider-chat" diff --git a/src/runtime/incus.rs b/src/runtime/incus.rs index 000b444..df043a0 100644 --- a/src/runtime/incus.rs +++ b/src/runtime/incus.rs @@ -175,6 +175,14 @@ impl Runtime for IncusRuntime { run_ok("incus", &launch_args).await?; + // Expand the root disk to 20GB (Incus default is 10GB, too small for + // NixOS with dev tools). Must be done after launch, before provisioning. + let _ = run_ok( + "incus", + &["config", "device", "override", &vm, "root", "size=20GiB"], + ) + .await; + // Wait for the VM agent to be ready before provisioning. // The guest agent takes time to start after boot. println!("Waiting for VM agent to be ready..."); diff --git a/src/runtime/lima.rs b/src/runtime/lima.rs index 0ff9a3b..0378c0d 100644 --- a/src/runtime/lima.rs +++ b/src/runtime/lima.rs @@ -82,6 +82,7 @@ vmOpts: cpus: {cpu} memory: "{memory}" +disk: "20GiB" mounts: {mounts_yaml} diff --git a/src/sandbox/provision.rs b/src/sandbox/provision.rs index da20175..1899623 100644 --- a/src/sandbox/provision.rs +++ b/src/sandbox/provision.rs @@ -149,8 +149,8 @@ fn nix_packages_for_set(set: &str) -> Vec<&'static str> { "trippy", "doggo", ], + // claude-code is installed separately via npm (latest version, smaller footprint) "ai-code" => vec![ - "claude-code", "codex", "opencode", "aider-chat",