| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | minimumLimaVersion: 2.1.0 |
| 6 | |
| 7 | base: |
| 8 | - template:_images/macos |
| 9 | |
| 10 | - template:_default/mounts |
| 11 | |
| 12 | |
| 13 | video: |
| 14 | display: "default" |
| 15 | |
| 16 | message: | |
| 17 | The user password for GUI session is stored in the `~/password` file in the guest. |
| 18 | Consider changing it after the first login. |
| 19 | |
| 20 | provision: |
| 21 | - mode: data |
| 22 | path: /usr/local/bin/lima-sudo-askpass.sh |
| 23 | permissions: 755 |
| 24 | content: | |
| 25 | #!/bin/sh |
| 26 | set -eu |
| 27 | # This script is expected to be used only for the initial setup. |
| 28 | # This script stops working after the user changes the password. |
| 29 | cat "$HOME/password" |
| 30 | - mode: user |
| 31 | script: | |
| 32 | #!/bin/bash |
| 33 | set -eux -o pipefail |
| 34 | [ -e /opt/homebrew ] && exit 0 |
| 35 | curl -o homebrew-install.sh -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh |
| 36 | SUDO_ASKPASS=/usr/local/bin/lima-sudo-askpass.sh NONINTERACTIVE=1 /bin/bash homebrew-install.sh |
| 37 | rm -f homebrew-install.sh |
| 38 | # No /etc/profile.d on macOS |
| 39 | echo >> ~/.zprofile |
| 40 | echo 'eval "$(/opt/homebrew/bin/brew shellenv zsh)"' >> ~/.zprofile |
| 41 | echo >> ~/.bash_profile |
| 42 | echo 'eval "$(/opt/homebrew/bin/brew shellenv bash)"' >> ~/.bash_profile |