Note: This is a translation. Primary version (Japanese): README.ja.md
Run this:
sh -c "$(curl -fsSL https://raw.githubusercontent.com/hikch/dotfiles/main/bootstrap.sh)"or
git clone git@github.com:hikch/dotfiles.git ~/dotfiles
cd ~/dotfiles
make deploy
This will symlink the appropriate files in dotfiles to your home directory.
Everything is configured and tweaked within ~/dotfiles.
To install the packages and applications, run:
make initThis will install Devbox, configure global packages, install Homebrew applications, setup Fish shell, and apply macOS defaults.
$ cd ~/dotfiles
$ make help
deploy Deploy dotfiles.
devbox-global-install devbox global install
fish Install fish plug-ins & Add direnv hook
homebrew Install homebrew packages
init Initialize.
mac-defaults Setup macos settings
vim Install vim plug-insQuickly validate what make deploy would symlink without touching your real home by using a temporary HOME:
HOME=$(mktemp -d) make deployThis simulates deployment in an isolated sandbox directory so you can review output safely.
New Brewfile management with host-specific configuration:
# Package operations
make brew/setup # Install/upgrade packages from .Brewfile (and host include)
make brew/check # Check if everything is satisfied (with details)
make brew/cleanup # Show removable packages not in Brewfiles
make brew/cleanup-force # Remove packages not in Brewfiles
make brew/upgrade # Upgrade all (formulae & casks)
# Adding packages
make brew/cask-add NAME=app # Add GUI app to common .Brewfile
make brew/host-cask-add NAME=app # Add GUI app to current host Brewfile
# Utilities
make brew/dump-actual # Snapshot current state to Brewfile.actualThis repository follows a strict whitelist approach for managing configuration files:
What Gets Tracked:
- Only hand-edited declarative configuration files
- Files that are reproducible and meaningful across machines
- Files that contain no secrets, state, or auto-generated content
Decision Rules (all must be YES to track):
- Did I manually edit this file?
- Is it meaningful on other machines?
- Is it NOT a secret, state, or auto-generated file?
.config Directory:
- Default: Exclude everything
- Explicitly include:
fish/config.fish,fish/conf.d/*.fish,git/config,direnv/direnv.toml, etc. - Explicitly exclude:
fish_variables(working state), completions, auto-generated functions
.local Directory:
- Default: Exclude everything
- Exception: Self-written scripts (e.g.,
.local/bin/) - Devbox: Currently managed via
PARTIAL_LINKSfor.local/share/devbox/global/default/
See .config/.gitignore for the complete whitelist configuration.
This repository provides three migration tools for managing PARTIAL_LINKS:
When to use: Migrating from legacy full-directory symlink structure (one-time only)
make migrate-top-symlink-to-realWhat it does:
- Detects if parent directories (
.config,.local) are currently symlinks - Backs up all non-PARTIAL_LINKS content to
/tmp/dotfiles-migration-*/ - Converts symlink to real directory
- Restores non-managed files to home directory
- Cleans up non-PARTIAL_LINKS items from repository
- Creates selective symlinks for PARTIAL_LINKS paths only
Example:
Before:
~/.config -> ~/dotfiles/.config (full symlink)
After:
~/.config/ (real directory)
├── fish -> ~/dotfiles/.config/fish (symlink, managed)
├── git -> ~/dotfiles/.config/git (symlink, managed)
├── gcloud/ (real directory, local state)
└── gh/ (real directory, local state)
~/dotfiles/.config/ (repository)
├── fish/ (tracked)
├── git/ (tracked)
└── .gitignore (gcloud, gh removed from repo)
Safety: Destructive (requires backup), run only once during initial migration.
When to use: After adding new path to PARTIAL_LINKS file
# 1. Edit PARTIAL_LINKS to add .config/uv
# 2. Run migration
make migrate-add-partial-link path=.config/uvWhat it does:
- Backs up existing
~/.config/uvto/tmp/partial-link-add-*/ - Removes real directory
- Creates symlink
~/dotfiles/.config/uv -> ~/.config/uv - Prompts manual review of backup content
Important: Does NOT auto-copy files. Review backup and manually copy desired configuration to repository.
When to use: After removing path from PARTIAL_LINKS file
# 1. Edit PARTIAL_LINKS to remove .config/git
# 2. Run migration
make migrate-remove-partial-link path=.config/gitWhat it does:
- Backs up repository content to
/tmp/partial-link-remove-*/ - Removes symlink
- Creates real directory and copies content from repository
- Preserves repository content (manual cleanup needed)
Important: Repository content is preserved. Add to .gitignore or manually remove if no longer needed.
This repository uses a hybrid approach for optimal package management:
- Devbox: CLI tools and development utilities (Node.js, jq, ripgrep, mas, etc.)
- Homebrew Cask: GUI applications only (browsers, editors, productivity apps)
- Host-specific configuration: Different packages per machine via
hosts/directory
Background services are managed based on their scope:
brew services: System-wide, always-on daemons (tailscaled, syncthing, shared databases, GUI agents)- Integrated with macOS LaunchAgents/Daemons
- Persist across reboots and user sessions
devbox services: Project-scoped, version-pinned dependencies (development databases, local services)- Started/stopped with project environments
- Ensures reproducibility across different projects
Rule of thumb: System-wide → brew services, project-specific → devbox services
The .Brewfile supports automatic host-specific includes:
dotfiles/
.Brewfile # Common GUI applications
hosts/
iMac-2020.Brewfile # iMac-specific packages (e.g., server tools)
MacBookAir2025.Brewfile # MacBookAir-specific packages (e.g., dev tools)
Host files are automatically detected using hostname -s and included during brew bundle operations.
The deployment behavior is controlled by external configuration files:
CANDIDATES- Files and directories to be symlinked to$HOME(whitelist)EXCLUSIONS- Files and directories to exclude from deploymentPARTIAL_LINKS- Nested paths to symlink individually (parent dirs auto-excluded)
To modify what gets deployed:
- Edit
CANDIDATESto add new deploy targets - Edit
EXCLUSIONSto exclude files/directories - Edit
PARTIAL_LINKSto add selective nested path symlinks - Run
make deployto apply changes
Syncthing installation varies by host:
Common (all machines):
- GUI application via
cask "syncthing"
Host-specific (iMac only):
- CLI version via
brew "syncthing"for server functionality
Usage:
# Desktop use (all machines)
open /Applications/Syncthing.app
# Server use (iMac only)
brew services start syncthing
brew services stop syncthing- devbox - Primary package manager for development tools
- direnv
- fish - Shell with Fisher plugin management
- homebrew - macOS applications and some CLI tools
- jq
- macvim
- ripgrep
- tmux and more...
- Make script for creating ssh settings when adding a remote host.
- Split Makefile into modular files (make/deploy.mk, make/homebrew.mk, make/devtools.mk, make/macos.mk)
- Use the defaults command to automate MacOS settings
- Switch to package management using Devbox
- Migrate from Nix to Devbox for better compatibility