Languages: English | 日本語 | Español | Português | 中文 | 한국어
This repository sets up a macOS development environment.
It combines dotfiles and Ansible so you can bootstrap a new Mac quickly and consistently.
setup-mac/
├── dotfiles/ # Configuration files
│ ├── .zshenv
│ ├── .gitconfig
│ └── .config/
│ ├── zsh/
│ │ └── .zshrc
│ ├── git/
│ │ └── config
│ ├── sheldon/
│ │ └── plugins.toml
│ ├── wezterm/
│ │ └── wezterm.lua
│ └── starship.toml
└── ansible/ # Ansible playbooks
├── site.yml
└── roles/
├── homebrew/
├── vscode_extensions/
├── mise/ # Toolchain setup via mise
├── macos/
├── dotfiles/
└── xdg_normalize/
- macOS (Apple Silicon and Intel supported)
- Internet connection
git clone https://github.com/kumo01GitHub/setup-mac.git ~/setup-mac
cd ~/setup-macInstall Homebrew:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Install Ansible:
brew install ansiblecd ~/setup-mac/ansible
ansible-playbook site.ymlIf a task requires elevated privileges (for example, installing the docker cask), include --ask-become-pass:
ansible-playbook site.yml --ask-become-passTo run with Git identity values:
Git user name/email are resolved in this order:
- CLI vars (
-e git_user_name=... -e git_user_email=...) - Environment variables (
GIT_USER_NAME,GIT_USER_EMAIL) - Interactive prompt at runtime when still missing
GIT_USER_NAME="Your Name" GIT_USER_EMAIL="your.email@example.com" ansible-playbook site.yml
# or
ansible-playbook site.yml -e git_user_name="Your Name" -e git_user_email="your.email@example.com"- Add files under
dotfiles/ - Add paths to
ansible/custom.ymlusingdotfiles_files_extra
Note:
.gitconfigis managed separately via template.
You can add items to role defaults without editing defaults/main.yml, using only ansible/custom.yml.
- Edit
ansible/custom.yml - Add items using
*_extravariables
ansible/site.yml automatically loads ansible/custom.yml before roles run.
Example: ansible/custom.yml
homebrew_packages_extra:
homebrew_cask_apps_extra:
- firefox
mise_plugins_extra:
- java
mise_toolchains_extra:
- go@latest
dotfiles_files_extra:
- .config/mytool/config.tomlEdit dotfiles/.config/zsh/.zshrc for shell customization.
dotfiles/.zshenv contains the minimal, early-loaded settings (XDG variables and ZDOTDIR).
To apply changes, open a new terminal or run:
source ~/.config/zsh/.zshrcItems in this section can include optional tools/apps/extensions managed via ansible/custom.yml (*_extra).
| Package | Description |
|---|---|
| git | Version control |
| curl | HTTP client |
| bat | cat alternative with syntax highlighting |
| dockutil | Dock item management |
| tree | Directory tree viewer |
| ansible | Configuration management |
| eza | Modern ls alternative |
| lcov | Coverage measurement tool |
| jq | JSON processor |
| hadolint | Dockerfile linter |
| starship | Cross-shell prompt |
| mise | Runtime/version manager |
| delta | Git diff viewer |
| sheldon | Zsh plugin manager |
| Application | Description |
|---|---|
| Visual Studio Code | Code editor |
| WezTerm | Terminal emulator |
| Google Chrome | Web browser |
| Docker | Container runtime |
| FiraCode Nerd Font | Development font |
| Android Studio | Android IDE |
| Extension | ID |
|---|---|
| EditorConfig | EditorConfig.EditorConfig |
| indent-rainbow | oderwat.indent-rainbow |
| Prettier | esbenp.prettier-vscode |
| ESLint | dbaeumer.vscode-eslint |
| Python | ms-python.python |
| Pylance | ms-python.vscode-pylance |
| Dart | Dart-Code.dart-code |
| Flutter | Dart-Code.flutter |
| Kotlin | fwcd.kotlin |
| Swift | swiftlang.swift-vscode |
| Java Extension Pack | vscjava.vscode-java-pack |
| Gradle for Java | vscjava.vscode-gradle |
| Spring Boot Tools | vmware.vscode-spring-boot |
| YAML | redhat.vscode-yaml |
| XML | redhat.vscode-xml |
The playbook applies the following settings:
- Enable Dock auto-hide
- Rebuild Dock items from the app list defined in
ansible/roles/macos/tasks/main.yml - Hide recent apps in Dock (non-pinned apps disappear when closed)
- Show hidden files in Finder
- Always show file extensions
The xdg_normalize role migrates default non-XDG paths into XDG-compliant locations and removes legacy paths.
Migration list (default path → XDG path):
| Tool | Category | Default path | XDG path |
|---|---|---|---|
| Homebrew | Cache | ~/Library/Caches/Homebrew |
~/.cache/Homebrew |
| Ansible | Data | ~/.ansible |
~/.local/share/ansible |
| Android SDK | Data | ~/.android |
~/.local/share/android |
| Gradle | Data | ~/.gradle |
~/.local/share/gradle |
| Docker | Config | ~/.docker |
~/.config/docker |
| mise | Data | ~/.mise |
~/.local/share/mise |
| hadolint | Config | ~/.hadolint.yaml |
~/.config/hadolint.yaml |
| npm | Cache | ~/.npm |
~/.cache/npm |
| npm | Config | ~/.npmrc |
~/.config/npm/npmrc |
Flutter/Dart (pub) |
Cache | ~/.pub-cache |
~/.cache/pub |
| pip | Config | ~/.pip |
~/.config/pip |
| pip | Cache | ~/Library/Caches/pip |
~/.cache/pip |
| RubyGems | Cache | ~/.gem |
~/.cache/gem |
| CocoaPods | Data | ~/.cocoapods |
~/.local/share/cocoapods |
| Claude | Config | ~/.claude |
~/.config/claude |
| GitHub Copilot | Config | ~/.copilot |
~/.config/copilot |
| less | State | ~/.lesshst |
~/.local/state/less/history |
| Vim | State | ~/.viminfo |
~/.local/state/vim/viminfo |
| Zsh | Config | ~/.zshrc, ~/.zprofile, ~/.zlogin, ~/.zlogout |
~/.config/zsh/ |
| Zsh | History | ~/.zsh_history |
~/.local/state/zsh/history |
| Zsh | Sessions | ~/.zsh_sessions |
~/.local/state/zsh/sessions |
| Zsh | Completion cache | ~/.zcompdump* |
~/.config/zsh/ |
Note: Some tools may recreate legacy paths under ~ if they do not support XDG paths.