Skip to content

feat: explicit mount control with MountSpec pairs#15

Merged
TimBeyer merged 6 commits intomainfrom
feat/wire-mounts-wizard-home-prompt
Mar 13, 2026
Merged

feat: explicit mount control with MountSpec pairs#15
TimBeyer merged 6 commits intomainfrom
feat/wire-mounts-wizard-home-prompt

Conversation

@TimBeyer
Copy link
Owner

@TimBeyer TimBeyer commented Mar 13, 2026

Summary

Closes #13 — the home directory is not mounted by default. Users opt
in explicitly, and now have full control over what gets mounted where.

  • Replace string[] mounts with explicit MountSpec objects
    ({ location, mountPoint, writable? }) — no magic path derivation,
    users specify exactly where things land in the guest
  • Wizard configure step asks Y/n for home directory mount (default: No);
    answering yes sets { location: "~", mountPoint: "/mnt/host" }
  • Headless config uses the same object syntax
  • Lima YAML generation rewritten to use the yaml npm package — builds
    a data structure instead of string templates, eliminating indentation bugs
  • Tests parse YAML output structurally instead of string-matching

Before (string-based, magic derivation)

"mounts": ["~", "~/.ssh"]

After (explicit pairs)

"mounts": [
  { "location": "~", "mountPoint": "/mnt/host" },
  { "location": "/opt/data", "mountPoint": "/mnt/data", "writable": true }
]

Test plan

  • bun test — all 249 tests pass
  • bun run lint && bun run format:check — clean
  • Manual: wizard → decline home mount → no extra mounts in YAML
  • Manual: wizard → accept home mount → ~ at /mnt/host in YAML
  • Headless: "mounts": [{ "location": "~", "mountPoint": "/mnt/host" }] → mount appears
  • Headless: no mounts field → no extra mounts

Closes #13

🤖 Generated with Claude Code

TimBeyer and others added 6 commits March 13, 2026 09:06
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add extraMounts to VMConfig, VMCreateOptions, and LimaYamlOptions
- Add guestMountPoint() helper to derive guest paths from host paths
- Generate read-only mount entries in Lima YAML for extra mounts
- Add Y/n prompt in wizard configure step for home directory mount
- Pass extraMounts through create-vm and headless provisioning paths
- Map InstanceConfig.mounts → VMConfig.extraMounts in configToVMConfig
- Remove stale ~ mount from docs, update mounts section as wired up
- Add tests for guestMountPoint, extra mount YAML, and config mapping

Closes #13

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove guestMountPoint() and string[] mounts in favor of explicit
{ location, mountPoint, writable? } objects — no more implicit path
derivation, no namespace collisions, users control where things land.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extra mounts were rendered at the wrong indent level (4 spaces instead
of 2), causing Lima's YAML parser to reject them as non-map values.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace hand-crafted string templates with structured data serialized
via the `yaml` npm package. Eliminates indentation bugs and makes the
template easier to maintain. Tests now parse the output structurally
instead of string-matching.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@TimBeyer TimBeyer changed the title feat: wire up extra mounts and add wizard home dir prompt feat: explicit mount control with MountSpec pairs Mar 13, 2026
@TimBeyer TimBeyer merged commit 13f8eef into main Mar 13, 2026
4 checks passed
@TimBeyer TimBeyer deleted the feat/wire-mounts-wizard-home-prompt branch March 13, 2026 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature request: disable sharing the host home directory

1 participant