Personal dotfiles for macOS development environment. Originally forked from @holman/dotfiles, now restructured for better organization and ~/.config support.
- Topic-based organization - Configuration grouped by application/tool
- Per-host configuration - Different packages for different machines
~/.configsupport - Sync XDG-compliant app configs (Zed, etc.)- Dry-run mode - Preview changes before applying
- Automatic backups - Existing files are backed up before replacing
git clone https://github.com/lukecartledge/dotfiles.git ~/.dotfiles cd ~/.dotfiles script/bootstrap
You can clone the repo anywhere; bootstrap will symlink it to ~/.dotfiles.
.dotfiles/
├── bin/ # Executable utilities (added to $PATH)
│ ├── dot # Update script - run periodically
│ ├── host # Returns current hostname
│ └── ...
├── home/ # User configuration organized by app
│ ├── git/
│ │ ├── gitconfig # → ~/.gitconfig
│ │ ├── gitignore # → ~/.gitignore
│ │ ├── *.zsh # Shell configuration (auto-sourced)
│ │ ├── install.bash # Setup script (e.g., prompt for credentials)
│ │ └── link.bash # Symlink definitions
│ ├── zsh/
│ │ ├── zshrc # → ~/.zshrc
│ │ └── *.zsh # Additional shell config
│ ├── zed/
│ │ ├── config/ # → ~/.config/zed/
│ │ └── link.bash
│ └── ...
├── hosts/ # Per-machine package configuration
│ └── {hostname}.bash # Defines PACKAGES array for each machine
├── macos/ # macOS system preferences
├── homebrew/ # Homebrew installation
├── script/
│ ├── bootstrap # Initial setup script
│ ├── run # Main installation script
│ └── common.bash # Shared functions
└── Brewfile # Homebrew packages
Each machine has a configuration file in hosts/{hostname}.bash that defines which packages to install:
# hosts/My-MacBook-Pro.bash export SYSTEM="macos" export PACKAGES=( system zsh git vim zed tmux ruby )
Find your hostname with: hostname -s
Each package in home/ can contain:
| File | Purpose |
|---|---|
*.zsh |
Shell configuration (auto-sourced by zshrc) |
path.zsh |
PATH setup (loaded first) |
completion.zsh |
Autocompletion (loaded last) |
install.bash |
One-time setup (e.g., prompt for credentials) |
link.bash |
Symlink definitions |
| Config files | Actual dotfiles (gitconfig, vimrc, etc.) |
Link scripts define where files should be symlinked:
# home/git/link.bash link_home "$HOME_DIR/git/gitconfig" "gitconfig" # → ~/.gitconfig link_home "$HOME_DIR/git/gitignore" "gitignore" # → ~/.gitignore
For ~/.config directories:
# home/zed/link.bash link "$HOME_DIR/zed/config/settings.json" "$HOME/.config/zed/settings.json"
script/bootstrap
Sets up everything: creates symlinks, installs Homebrew, runs package scripts.
dot
Pulls latest changes, updates Homebrew, sets macOS defaults, and runs script/run.
Preview what would happen without making changes:
script/run --dry
# or
dot --drydot --edit
Opens the dotfiles directory in your editor.
-
Create a directory in
home/:mkdir -p home/myapp/config
-
Add configuration files
-
Create
link.bash:# home/myapp/link.bash link_home "$HOME_DIR/myapp/config" "myapprc" # or for ~/.config: link "$HOME_DIR/myapp/config" "$HOME/.config/myapp"
-
Add to your host configuration:
# hosts/{hostname}.bash export PACKAGES=( ... myapp )
-
Run
script/runto apply
-
Find your hostname:
hostname -s
-
Create host configuration:
cp hosts/Luke-Cartledge-MacBookPro.bash hosts/{your-hostname}.bash -
Edit the packages list for your machine
-
Run bootstrap:
script/bootstrap
Files containing API tokens or secrets should use the .local pattern:
settings.json- Tracked in git (no secrets)settings.local.json- Git-ignored (contains tokens)
Example files are provided with .example suffix:
cp home/zed/config/settings.local.json.example home/zed/config/settings.local.json
# Edit and add your tokensSystem preferences are set via macos/set-defaults.sh. These are applied when running dot or script/bootstrap.
Changes may require logout/restart to take effect.
Create a host file for your machine:
hostname -s # Get your hostname
cp hosts/Luke-Cartledge-MacBookPro.bash hosts/{your-hostname}.bashExisting files are automatically backed up with a timestamp:
~/.gitconfig.backup.20240131120000
To restore:
mv ~/.gitconfig.backup.20240131120000 ~/.gitconfig
Source your zshrc:
source ~/.zshrc
Or restart your terminal.
MIT