lima-vm / lima

Linux virtual machines, with a focus on running containers
https://lima-vm.io/
Apache License 2.0
14.61k stars 572 forks source link

Provide standard values "default" and "none" for most options #2458

Open afbjorklund opened 1 week ago

afbjorklund commented 1 week ago

Description

It would be nice to be able to use simple defaults like "default".

audio:
  # EXPERIMENTAL
  # QEMU audiodev, e.g., "none", "coreaudio", "pa", "alsa", "oss".
  # Choosing "none" will mute the audio output, and not play any sound.
  # Choosing "default" will pick the suitable of coreudio, pa, dsound.
  # 🟢 Builtin default: ""
  device: default

video:
  # QEMU display, e.g., "none", "cocoa", "sdl", "gtk", "vnc", "default".
  # Choosing "none" will hide the video output, and not show any window.
  # Choosing "default" will pick the first available of: gtk, sdl, cocoa.
  # 🟢 Builtin default: "none"
  display: default

Instead of having to remember gtk and pa, or vz, or whatever...

Note: Vz will not support the QEMU device/driver names. But it should still honor the "none" and "default" strings.

afbjorklund commented 1 week ago

Other PRs used the same ("default") also for images and mounts:

images:
- default

mounts:
- default

But those are arrays, so "none" is usually just written out as [].

One could have the string ("none") expand to the empty list?