Managed with chezmoi. One repo targets macOS,
Linux, WSL, and disposable remote boxes; a machine class chosen at init
time (mac / linux / wsl / ephemeral) controls what gets deployed.
Warning: If you want to give these dotfiles a try, you should first fork this repository, review the code, and remove things you don’t want or need. Don’t blindly use my settings unless you know what that entails. Use at your own risk!
sh -c "$(curl -fsLS get.chezmoi.io)" -- init --apply hadeesInstalls chezmoi to ~/.local/bin, clones this repo, prompts once for the
machine class, and applies.
sh -c "$(curl -fsLS get.chezmoi.io)" -- init --one-shot hadeesApplies the dotfiles, then removes chezmoi, its source clone, and its config
from the machine. Answer ephemeral to the machine-class prompt: that class
deploys shell config only — no git identity and no secrets ever touch disk.
For commit signing on a box you keep around, forward your local 1Password
SSH agent (per-host ForwardAgent yes) instead of putting keys there.
brew install chezmoi
git clone git@github.com:hadees/dotfiles.git ~/code/dotfiles
chezmoi init --source ~/code/dotfiles --applyThe mac machine class pins chezmoi’s sourceDir to the clone, so the
day-to-day loop is: edit files in ~/code/dotfiles, review with
chezmoi diff, deploy with chezmoi apply (aliased to dotfiles).
If ~/.path exists, it will be sourced along with the other files, before any feature testing (such as detecting which version of ls is being used) takes place.
Here’s an example ~/.path file that adds /usr/local/bin to the $PATH:
export PATH="/usr/local/bin:$PATH"If ~/.extra exists, it will be sourced along with the other files. On
managed machines it is rendered by chezmoi from private_dot_extra.tmpl,
which pulls secret values out of 1Password at apply time — see CLAUDE.md
“Machine-local secrets” for the syntax. On the ephemeral machine class it
is never deployed at all.
You could also use ~/.extra to override settings, functions and aliases from my dotfiles repository. It’s probably better to fork this repository instead, though.
When setting up a new Mac, you may want to set some sensible macOS defaults:
./.macosTo keep separate machine names, export COMPUTER_NAME before running the script, e.g. COMPUTER_NAME="Work-Mac" ./.macos. If the variable is not set, the existing system name is left unchanged so each Mac can keep its own identity.
When setting up a new Mac, you may want to install some common Homebrew formulae (after installing Homebrew, of course):
brew bundleSuggestions/improvements welcome!
- Mathias Bynens
- @ptb and his macOS Setup repository
- Ben Alman and his dotfiles repository
- Cătălin Mariș and his dotfiles repository
- Gianni Chiappetta for sharing his amazing collection of dotfiles
- Jan Moesen and his ancient
.bash_profile+ shiny tilde repository - Lauri ‘Lri’ Ranta for sharing loads of hidden preferences
- Matijs Brinkhuis and his dotfiles repository
- Nicolas Gallagher and his dotfiles repository
- Sindre Sorhus
- Tom Ryder and his dotfiles repository
- Kevin Suttle and his dotfiles repository and macOS-Defaults project, which aims to provide better documentation for
~/.macos - Haralan Dobrev
- Anyone who contributed a patch or made a helpful suggestion