Note: For anyone suggesting to use Ansible, this setup works for my needs. I don't require all the options provided by Ansible, nor do I want to do the extra setup.
Steps to make a new machine easier to setup
-
cd to the script directory.
-
Make sure make the script executable with
chmod u+x setup-machine.zshthen run it with./setup-machine.zsh -
Make sure that the
dock.zshscript is executable withchmod u+x dock.zsh -
The same can be for the backup script
chmod u+x backup.zshThen with the backup script you add it as a cron job.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zshrc
eval "$(/opt/homebrew/bin/brew shellenv)"
brew bundle --file [clone location]/Brewfile
cd [clone location] && brew bundle
In our case, the files are all backed up via iCloud. As a note, at the time of backing up on March 4, 2024, the symlink on macOS 14 seems to be broken and does not allow the linked files to be read correctly.
nvim ~/.mackup.cfgAdd this
[storage]
engine = icloudSave
mackup restore --force && mackup uninstall --force
As of writing, this is the best way, as it is somewhat broken on macOS 14, due to broken symlinks. lra/mackup#1924 (comment)