projects

dotfiles

My configuration files

init-vm.sh 1.7 KB · 55 lines Raw
#!/bin/bash# Set up a new OrbStack VM.# Run this on your Mac:#   ./init-vm.sh MACHINE_NAME# Afterwards, ssh in and paste your bashrc at the end of ~/.bashrcset -e   # stop if any step failsNAME="$1"if [ -z "$NAME" ]; then  echo "Usage: ./init-vm.sh MACHINE_NAME"  exit 1fi# Folders in ~/.config on your Mac to copy into the VM. Edit as needed.CONFIGS="fzf helix bat"echo "== 0. Create isolated VM with mounted project folder =="orb create --isolated --forward-ssh-agent \  --mount /Users/daniel/projects:/home/daniel/projects \  ubuntu:resolute "$NAME" --isolate-network# The mount creates /home/daniel as root, so give it back to youorb -m "$NAME" sudo chown daniel:daniel /home/daniel# Because of that, Ubuntu skipped the default shell files. Copy them in.orb -m "$NAME" cp /etc/skel/.bashrc /etc/skel/.profile /etc/skel/.bash_logout /home/daniel/echo "== 1. Install standard packages =="orb -m "$NAME" sudo apt updateorb -m "$NAME" sudo apt modernize-sourcesorb -m "$NAME" sudo apt install -y nano vim-tiny less ca-certificates curl gnupg wget xz-utils unzip git build-essential passt bubblewraporb -m "$NAME" sudo apt updateecho "== 2. Install mise =="orb -m "$NAME" bash -c 'curl https://mise.run | sh'echo "== 3. Install global tools with mise =="orb -m "$NAME" bash -c '~/.local/bin/mise use -g bat delta difftastic eza fd fzf helix jj jq node pi ripgrep zoxide'echo "== 4. Copy ~/.config folders from your Mac =="orb -m "$NAME" mkdir -p /home/daniel/.configfor folder in $CONFIGS; do  echo "  copying $folder"  orb push -m "$NAME" ~/.config/$folder /home/daniel/.config/doneecho "Done. Now run: ssh $NAME@orb"echo "Then paste your bashrc at the end of ~/.bashrc"