This repository manages dotfiles for both macOS and Linux using chezmoi, with Homebrew as the primary package manager on both platforms.
- ✅ Unified package management via Homebrew on both macOS and Linux
- ✅ OS-specific configurations using chezmoi templates
- ✅ Automated setup with install scripts
- ✅ Git integration with auto-commit and auto-push
TL;DR - One command to set up everything:
# macOS or Linux
sh -c "$(curl -fsLS get.chezmoi.io)" -- init --apply yourusername/dotfilesReplace yourusername/dotfiles with your repo!
📖 For detailed instructions, troubleshooting, and step-by-step guide, see BOOTSTRAP.md
The one-line command will:
- Install chezmoi
- Clone your dotfiles repository
- Prompt for machine type (home/work/server)
- Linux: Install Homebrew + essential packages
- macOS: Use existing Homebrew
- Install all packages from Brewfile
- Apply all dotfiles to your home directory
- Change shell to zsh
- Configure everything automatically
- home - Personal laptop with Kubernetes tools, interactive 1Password
- work - Work laptop without Kubernetes, interactive 1Password
- server - AI assistant/automation, token-based 1Password (requires
OP_SERVICE_ACCOUNT_TOKEN)
See MACHINE_TYPES.md and SERVER_SETUP.md for details.
The setup will:
- Linux only: Install Homebrew and essential build tools
- Install all Homebrew packages (git, node, bat, eza, ripgrep, etc.)
- macOS only: Install Homebrew cask applications
- Configure zsh as default shell
- Set up all dotfiles
Scripts run in this order (chezmoi naming convention):
run_once_before_00-install-homebrew.sh- Installs Homebrew on Linuxrun_once_before_01-install-linux-essentials.sh- Installs Linux-specific packages (libfuse2, zsh, etc.)run_onchange_install-brew-packages.sh- Installs packages fromBrewfilerun_once_after_chsh.sh- Changes shell to zsh and builds bat cache
run_onchange_install-brew-packages.sh- Installs packages and casks fromBrewfilerun_onchange_after_macos_defaults.sh- Sets macOS-specific defaultsrun_onchange_after_configure.sh- Additional macOS configurationrun_once_after_chsh.sh- Changes shell to zsh and builds bat cache
- Shell tools: bat, eza, fd, ripgrep, zoxide, tmux
- Dev tools: git, git-lfs, gh, lazygit, node
- Utilities: curl, wget
- Alacritty (terminal emulator)
- Nerd Fonts (Fira Code, Roboto Mono, Inconsolata)
- Visual Studio Code
- VLC
- 1Password CLI
- libfuse2 (AppImage support)
- zsh
- unzip
chezmoi add ~/.config/nvim/init.luachezmoi edit ~/.zshrcchezmoi applychezmoi updateEdit Brewfile.tmpl and add packages:
# For CLI tools (both macOS and Linux)
brew "your-new-package"
# For macOS-only GUI apps
{{ if eq .chezmoi.os "darwin" -}}
cask "your-app"
{{ end -}}Then apply changes:
chezmoi apply
brew bundle --globalUse chezmoi templates with conditionals:
{{ if eq .chezmoi.os "darwin" -}}
# macOS specific
{{ else if eq .chezmoi.os "linux" -}}
# Linux specific
{{ end -}}Ensure your shell sources the Homebrew environment. The .zshrc includes:
if [[ -f /home/linuxbrew/.linuxbrew/bin/brew ]]; then
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
fiCheck script permissions:
chezmoi execute-template < .chezmoiscripts/run_onchange_install-brew-packages.sh.tmplchezmoi state delete-bucket --bucket=scriptState
chezmoi apply.
├── .chezmoi.toml.tmpl # Chezmoi configuration
├── .chezmoiscripts/ # Setup scripts
│ ├── darwin/ # macOS-specific scripts
│ ├── linux/ # Linux-specific scripts
│ └── run_onchange_*.sh.tmpl # Cross-platform scripts
├── dot_zshrc # Zsh configuration
├── dot_config/ # Application configs
└── README.md # This file
The setup has been improved for cross-platform compatibility:
- ✅ Added Homebrew installation script for Linux
- ✅ Removed redundant apt package installations (now using Homebrew)
- ✅ Removed custom Node.js installation (now via Homebrew)
- ✅ Added proper PATH setup for Homebrew on Linux
- ✅ Added error handling and validation checks
- ✅ Unified package management across both platforms
Old scripts have been preserved as .bak files:
run_onchange_install-apt-packages.sh.tmpl.bakrun_once_before_install-nodejs.sh.tmpl.bak