Skip to content

Instantly share code, notes, and snippets.

@95gabor
Last active March 7, 2025 07:53
Show Gist options
  • Save 95gabor/dfac9fddcf8b0529474805f1ac76f790 to your computer and use it in GitHub Desktop.
Save 95gabor/dfac9fddcf8b0529474805f1ac76f790 to your computer and use it in GitHub Desktop.
Lima
# Usage:
# `limactl create --name=default ./alpine.yaml`
# `limactl start`
images:
- location: "https://dl-cdn.alpinelinux.org/alpine/v3.21/releases/cloud/nocloud_alpine-3.21.2-x86_64-uefi-cloudinit-r0.qcow2"
arch: "x86_64"
digest: "sha512:1aaf22b4a584e69e228e6aa38a295159c0143d9ccebe7ad4928e92b414714066af3bfe5f9e0ca4d4d64a70ca9fea09033af90258a6f2344130d70b660151127a"
- location: "https://dl-cdn.alpinelinux.org/alpine/v3.21/releases/cloud/nocloud_alpine-3.21.2-aarch64-uefi-cloudinit-r0.qcow2"
arch: "aarch64"
digest: "sha512:08d340126b222abae651a20aa63c3ee3dc601d703de7879d2a6bc1fe82a3664d058a2c55ad0cf8a874327f7535e3af8a9384ce438217d6f32200cad1462a5b32"
mountInotify: true
mounts:
- location: "~"
writable: true
- location: "/tmp/lima"
writable: true
cpus: 6
memory: 16GiB
# The built-in containerd installer does not support Alpine currently.
containerd:
system: false
user: false
user:
shell: /bin/zsh
provision:
- mode: system
script: |
#!/bin/bash
set -eux -o pipefail
# exit when zsh prepared
if [[ -f ~/.zshrc ]]; then
exit 0
fi
# app packages
apk update
apk add \
curl \
containerd \
buildkit \
buildctl \
nerdctl \
git \
htop \
fastfetch \
zsh \
zsh-theme-powerlevel10k \
font-jetbrains-mono-nerd \
fzf
# ruby-dev make gcc musl-dev
# gem install colorls
# start containerd
rc-update add containerd
rc-service containerd start
# start buildkitd
rc-update add buildkitd
rc-service buildkitd start
- mode: user
script: |
#!/bin/bash
set -eux -o pipefail
# nerdctl without sudo
sudo chmod +s /usr/bin/nerdctl
# exit when zsh prepared
if [[ -f ~/.zshrc ]]; then
exit 0
fi
# setup oh my zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# setup p10k
mkdir -p ~/.local/share/zsh/plugins
ln -s /usr/share/zsh/plugins/powerlevel10k ~/.local/share/zsh/plugins/
curl https://gist.githubusercontent.com/95gabor/a4bc9c7a090423fb92ce26e4f50a7893/raw/03e7ed5d0ac8df24e03398b5d7b4de6497ed9e5f/.p10k.zsh -L -o ~/.p10k.zsh
# configure .zshrc
cat <<'EOF' >> ~/.zshrc
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# fzf
eval "$(fzf --zsh)"
# To customize prompt, run `p10k configure` or edit ~/.p10k.zsh.
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment