66
77# Derive paths from synced folder source (BASE_DIR from Taskfile, or current dir)
88HOST_PATH = ENV [ "BASE_DIR" ] || File . expand_path ( "." )
9- DEVCELL_DIR = File . expand_path ( "." ) # Where this Vagrantfile lives
9+ DEVCELL_DIR = File . dirname ( File . expand_path ( __FILE__ ) ) # Where this Vagrantfile lives
1010FOLDER_NAME = File . basename ( HOST_PATH )
1111DEVCELL_FOLDER = File . basename ( DEVCELL_DIR )
1212
@@ -28,7 +28,7 @@ Vagrant.configure("2") do |config|
2828 config . vm . define VM_NAME
2929 config . vm . hostname = VM_NAME
3030
31- config . vm . box = ENV [ "MACOS_BOX" ] || "macOS26"
31+ config . vm . box = ENV [ "MACOS_BOX" ] || "devcell- macOS26"
3232 config . vm . box_url = ENV [ "MACOS_BOX_URL" ] if ENV [ "MACOS_BOX_URL" ]
3333
3434 # Direct SSH to VM (no port forwarding for Apple Virtualization)
@@ -47,14 +47,13 @@ Vagrant.configure("2") do |config|
4747 if HOST_PATH != DEVCELL_DIR
4848 config . vm . synced_folder DEVCELL_DIR , "/devcell" , type : :utm
4949 end
50- # Claude/Codex config directories (shared between host and guest)
51- config . vm . synced_folder "#{ CELL_HOME } /.claude" , "/Users/vagrant/.claude" , type : :utm , create : true
52- config . vm . synced_folder "#{ CELL_HOME } /.codex" , "/Users/vagrant/.codex" , type : :utm , create : true
50+ # Claude/Codex config home (CELL_HOME contains .claude/, .claude.json, .codex/)
51+ config . vm . synced_folder CELL_HOME , "/cell-home" , type : :utm , create : true
5352
5453 config . vm . provider :utm do |utm |
5554 utm . name = VM_NAME
56- utm . memory = 4096
57- utm . cpus = 2
55+ utm . memory = 8192
56+ utm . cpus = 4
5857 utm . check_guest_additions = false
5958 # Apple Virtualization: skip QEMU directory_share_mode (uses VirtioFS instead)
6059 utm . skip_directory_share_mode = true
@@ -74,9 +73,13 @@ Vagrant.configure("2") do |config|
7473 ln -sfn "#{ DEVCELL_VIRTFS_MOUNT } " "#{ DEVCELL_GUEST_PATH } "
7574 fi
7675
77- # Claude/Codex config symlinks (VirtioFS mounts to ~/.claude and ~/.codex)
78- [ -d "/Volumes/My Shared Files/.claude" ] && ln -sfn "/Volumes/My Shared Files/.claude" ~/.claude
79- [ -d "/Volumes/My Shared Files/.codex" ] && ln -sfn "/Volumes/My Shared Files/.codex" ~/.codex
76+ # Claude/Codex config symlinks from CELL_HOME mount
77+ CELL_MOUNT="/Volumes/My Shared Files/#{ File . basename ( CELL_HOME ) } "
78+ if [ -d "$CELL_MOUNT" ]; then
79+ [ -d "$CELL_MOUNT/.claude" ] && ln -sfn "$CELL_MOUNT/.claude" ~/.claude
80+ [ -f "$CELL_MOUNT/.claude.json" ] && ln -sfn "$CELL_MOUNT/.claude.json" ~/.claude.json
81+ [ -d "$CELL_MOUNT/.codex" ] && ln -sfn "$CELL_MOUNT/.codex" ~/.codex
82+ fi
8083 SHELL
8184
8285 # # Fix home directory permissions (in case previous provisioning created files as root)
@@ -87,8 +90,14 @@ Vagrant.configure("2") do |config|
8790 # done
8891 # FIX_PERMS
8992
93+ # =============================================================================
94+ # BASE PROVISIONERS (already done in devcell-macOS26 box, kept for reference)
95+ # To re-run: vagrant provision --provision-with asdf
96+ # To rebuild base box: MACOS_BOX=macOS26 vagrant up --provision
97+ # =============================================================================
98+
9099 # Install asdf via Homebrew (run as vagrant user, not root)
91- config . vm . provision "shell" , name : "asdf" , privileged : false , inline : <<~ASDF_BREW
100+ config . vm . provision "shell" , name : "asdf" , run : "never" , privileged : false , inline : <<~ASDF_BREW
92101 if ! command -v brew >/dev/null 2>&1; then
93102 echo "Homebrew not found. Installing..."
94103 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" < /dev/null
@@ -108,7 +117,7 @@ Vagrant.configure("2") do |config|
108117 ASDF_BREW
109118
110119 # Install asdf plugins (mirrors Dockerfile)
111- config . vm . provision "shell" , name : "asdf-plugins" , privileged : false , inline : <<~ASDF_PLUGINS
120+ config . vm . provision "shell" , name : "asdf-plugins" , run : "never" , privileged : false , inline : <<~ASDF_PLUGINS
112121 export PATH="${ASDF_DATA_DIR:-$HOME/.asdf}/shims:$(brew --prefix asdf)/libexec:$PATH"
113122
114123 asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git || true
126135# Load secondary Vagrantfile from HOST_PATH (user's project directory) if it exists
127136# This allows projects to extend the base configuration (similar to Dockerfile-local)
128137# Must be outside the configure block so both configure blocks are at the same level
129- user_vagrantfile = File . join ( HOST_PATH , "Vagrantfile.local" )
138+ user_vagrantfile = File . join ( DEVCELL_DIR , "Vagrantfile.local" )
130139if File . exist? ( user_vagrantfile )
131140 puts "Loading Vagrantfile.local from: #{ user_vagrantfile } "
132141 load user_vagrantfile
133- else
134- puts "Vagrantfile.local not found at: #{ user_vagrantfile } "
135142end
0 commit comments