Customization
This guide covers common ways to extend or modify the mac-setup setup.
Adding a Homebrew Formula
- Open
roles/homebrew/vars/main.yml - Add the formula name to the
homebrew_formulaelist - Run
make setup
Alternatively, install the formula normally with brew install <name>, then run make cleanup — the cleanup step will detect it as unmanaged and prompt you to either add it to the list or remove it.
Adding a Homebrew Cask
Same pattern as formulae, but use the homebrew_casks list in roles/homebrew/vars/main.yml.
homebrew_casks: - firefox - rectangle - your-new-cask # add hereThe playbook sets accept_external_apps: true, which means apps that were installed outside of Homebrew (e.g., downloaded directly from a website) are detected and skipped rather than causing an error.
Adding a VS Code Extension
- Open
roles/apps/vars/main.yml - Add the extension identifier to the
vscode_extensionslist - Run
make setup
Extension identifiers use the publisher.extension format (e.g., ms-python.python). You can find the identifier on the VS Code Marketplace or by running code --list-extensions.
Adding an App Config
To bring a new application’s config under management:
- Place config files in
configs/<app>/— mirror the structure the app expects - Add a symlink task to the relevant role in
roles/<role>/tasks/main.yml:- name: Symlink <app> configansible.builtin.file:src: "{{ repo_dir }}/configs/<app>/config-file"dest: "~/.config/<app>/config-file"state: linkforce: true - Add validation to
scripts/validate.shto verify the symlink is correct:Terminal window check_symlink "$HOME/.config/<app>/config-file" "$MAC_SETUP_DIR/configs/<app>/config-file"
Adding a Raycast Script Command
Raycast script commands live in configs/raycast/script-commands/. To add one:
- Create a new
.sh,.py, or.applescriptfile in that directory - Include the required Raycast metadata headers at the top of the file:
#!/bin/bash# Required parameters:# @raycast.schemaVersion 1# @raycast.title My Script# @raycast.mode compact# Optional parameters:# @raycast.icon# @raycast.packageName My Packageecho "Hello from Raycast"
- Make the file executable:
chmod +x configs/raycast/script-commands/my-script.sh
The Ansible playbook uses a find task to auto-discover all script files in that directory, so no additional configuration is needed.
Removing Packages
To remove a formula or cask that was previously managed:
- Remove it from
homebrew_formulaeorhomebrew_casks - Add it to the corresponding removal list:
homebrew_formulae_absentfor formulaehomebrew_casks_absentfor casks
- Run
make setup
The playbook will uninstall the package on the next run.
Adding Mise Runtimes
To add or change globally managed runtimes (Node.js, Python, Go, etc.):
- Edit
configs/mise/config.toml - Add or update the tool version:
[tools]node = "lts"python = "3.12"go = "latest" # add new runtime here
- Run
make setupto install the runtime
Adding npm Global Packages
To add globally installed npm packages (managed through Mise’s Node.js):
- Open
roles/mise/vars/main.yml - Add the package name to the
npm_global_packageslist:npm_global_packages:- prettier- eslint- your-package # add here - Run
make setup