A comprehensive personal development environment setup using chezmoi for managing dotfiles and system configuration, optimized for macOS with dedicated Linux (Debian/Ubuntu) support.
- Automated Environment Setup: Complete macOS and Linux development environment setup via chezmoi
- Dotfile Management: Version-controlled dotfiles with templating support
- Tool Installation: Automated installation of Homebrew packages (macOS) and apt-based tooling (Linux)
- Shell Configuration: Zsh with plugins, aliases, and custom functions via Zinit
- Git Integration: Comprehensive git aliases from GitAlias.com
- Cross-Machine Sync: Easy synchronization across multiple machines
-
Install chezmoi and initialize:
# macOS brew install chezmoi # Linux (Debian/Ubuntu) sudo apt install chezmoi # Initialize from your dotfiles repository chezmoi init --apply https://github.com/yourusername/dotfiles.git
-
Or use one-line setup:
sh -c "$(curl -fsLS get.chezmoi.io)" -- init --apply yourusername
# Update dotfiles from repository
chezmoi update
# Edit a dotfile
chezmoi edit ~/.zshrc
# Apply changes
chezmoi apply
# Check differences
chezmoi diff
# Add a new dotfile
chezmoi add ~/.newfile~/.local/share/chezmoi/
├── Brewfile.tmpl # Homebrew package definitions (templated per OS)
├── dot_gitconfig.tmpl # Git configuration (templated)
├── dot_gitignore # Global gitignore (Brewfile lock files, .DS_Store, etc.)
├── dot_zshrc # Zsh startup file with optimized loading order
├── dot_gitalias # Git aliases from GitAlias.com
├── dot_vimrc.tmpl # Cross-platform Vim configuration with vim-plug
├── dot_zsh/ # Zsh configuration modules
│ ├── path.zsh.tmpl # PATH setup with OS templating
│ ├── plugins.zsh # Zinit plugin manager (loads first)
│ ├── env.zsh.tmpl # Environment initialization (loads third)
│ ├── aliases.zsh # Command aliases (loads fourth)
│ └── functions.zsh # Custom shell functions (loads last)
├── scripts/ # Installation scripts with smart detection
│ ├── modify_Brewfile.sh.tmpl # Automatically apply Brewfile changes (templated per OS)
│ ├── run_once_before_00-setup-xcode.sh.tmpl
│ ├── run_once_before_01-install-base-packages.sh.tmpl
│ ├── run_once_before_02-install-development-tools.sh.tmpl
│ ├── run_once_after_00-setup-shell.sh.tmpl
│ └── run_once_after_99-verify-setup.sh.tmpl
└── private_dot_ssh/ # SSH configuration (templated per OS)
# Configuration (not tracked)
~/.config/chezmoi/chezmoi.toml # User data (email, name, SSH key)
Create ~/.config/chezmoi/chezmoi.toml to customize your setup:
[data]
email = "your.email@example.com"
name = "Your Name"
signing_key = "your-ssh-signing-key"This file is not tracked in the repository to keep your sensitive information secure.
- Modular Structure: Organized into separate files for maintainability
dot_zsh/aliases.zsh: Git, Docker, Kubernetes, AWS shortcutsdot_zsh/functions.zsh: Custom functions for proxy setup, AWS operationsdot_zsh/plugins.zsh: Zinit plugin manager with syntax highlighting, autosuggestions, zoxidedot_zsh/env.zsh.tmpl: Environment initialization and key bindings via templated OS sectionsdot_zsh/path.zsh.tmpl: PATH setup per platform (Homebrew vs. Linux paths) via templating
- Loading Order: Optimized for proper plugin initialization (plugins → env → aliases → functions)
- File:
dot_vimrcmanaged via chezmoi and sourced automatically by Vim - Plugin Manager: Bootstraps vim-plug on first launch (works on macOS & Linux)
- Navigation Plugins: Installs
easymotion/vim-easymotionandvim-scripts/ace_jump.vimto provide EasyMotion / AceJump workflows - Quality-of-life Plugins: Includes commentary, autopairs, gitgutter, and sensible defaults for indentation, clipboard, splits, and searching
- Keymaps: Leader-based shortcuts for EasyMotion (
<leader><leader>w/f/j/k) and AceJump (<leader>a,<leader>A) shared across OSes
- IDEs: VS Code, JetBrains Toolbox, Warp terminal
- Cloud Tools: AWS CLI (with aws-vault), kubectl, helm
- Containers: Docker, Kubernetes tools
- Languages: Python, Node.js (via asdf)
- Directory Navigation: zoxide (smart
zcommand) - note: conflicts with zinit'szi, usezfor navigation - Package Automation:
- A single templated
Brewfile.tmplplus templated run-once scripts switch between macOS Homebrew installs and Linux apt-based provisioning (scripts/run_once_before_01-install-base-packages.sh.tmpl,scripts/run_once_before_02-install-development-tools.sh.tmpl)
- A single templated
- Essential: 1Password, Alfred, CleanShot, Rectangle
- Communication: Slack, Discord, Zoom
- Browsers: Brave, Arc
- Utilities: Various system utilities and tools
If you're migrating from the original symlink-based MyDevTools:
-
Backup existing dotfiles:
cp ~/.zshrc ~/.zshrc.backup cp ~/.gitconfig ~/.gitconfig.backup
-
Remove old symlinks:
rm ~/.zshrc ~/.gitconfig ~/.gitalias rm -rf ~/.myzsh
-
Initialize chezmoi:
chezmoi init --apply
# Add a new dotfile to chezmoi
chezmoi add ~/.newconfig
# Edit it
chezmoi edit ~/.newconfig
# Apply changes
chezmoi apply- Before scripts:
run_once_before_*.shfor installation tasks (with smart detection) - After scripts:
run_once_after_*.shfor post-installation setup - Templates: Use
.tmplextension for OS-specific or user-specific content - Smart Detection: Scripts check for existing installations to avoid redundancy
Edit Brewfile.tmpl to add or remove macOS packages:
chezmoi edit ~/.local/share/chezmoi/Brewfile.tmpl
# Then install new packages
brew bundle install --file BrewfileFor the development tools installation scripts:
# macOS
chezmoi edit ~/.local/share/chezmoi/scripts/run_once_before_02-install-development-tools.sh.tmpl
# Linux
chezmoi edit ~/.local/share/chezmoi/scripts/run_once_before_02-install-development-tools.sh.tmpl- macOS: Apple Silicon and Intel Macs using Homebrew + Brewfile templating
- Linux: Debian/Ubuntu-based distributions using the templated apt automation scripts
- Optimized For: Consistent Zsh experience across both platforms
| Command | Description |
|---|---|
chezmoi init |
Initialize chezmoi |
chezmoi apply |
Apply dotfile changes |
chezmoi update |
Pull and apply latest changes |
chezmoi diff |
Show differences |
chezmoi edit <file> |
Edit a managed file |
chezmoi add <file> |
Add a file to chezmoi |
chezmoi status |
Show status |
chezmoi re-add |
Re-add modified files |
-
Permission denied on scripts: Ensure scripts are executable
chezmoi apply --force
-
Template errors: Check your
~/.config/chezmoi/chezmoi.toml -
Homebrew/apt not found:
- macOS: Restart terminal or run
eval "$(/opt/homebrew/bin/brew shellenv)" - Linux: Ensure
apt-getis available and rerun the install scripts
- macOS: Restart terminal or run
- Chezmoi Documentation
- GitAlias Documentation
- Check the repository issues for common problems
This is a personal dotfiles repository, but feel free to:
- Fork for your own use
- Submit issues for bugs
- Suggest improvements via pull requests
This configuration is provided as-is for personal use. Individual tools and applications have their own licenses.