macOS 개발 환경 dotfiles. chezmoi로 관리한다.
- 소스: 이 repo (
~/.local/share/chezmoi) - 대상:
$HOME—chezmoi apply로 배포 - 이전 방식: 심링크 기반
~/.dotfiles(아래 롤백 참고)
직접 git clone 하지 않는다. chezmoi가 대신 clone 한다.
chezmoi init <repo>
└─ 이 repo를 ~/.local/share/chezmoi 로 clone (chezmoi가 알아서)
chezmoi apply
└─ 소스를 렌더링해서 ~ 에 배포
| 구분 | 위치 | 역할 |
|---|---|---|
| 소스 | ~/.local/share/chezmoi |
git repo (chezmoi가 관리) |
| 대상 | $HOME |
실제 배포된 설정 파일 |
즉 새 머신에서 필요한 건 chezmoi 바이너리 하나뿐이다. repo 주소만 주면 clone·배포를 chezmoi가 다 한다.
# chezmoi 설치 + 소스 clone(~/.local/share/chezmoi) + ~ 에 apply 까지 전부
sh -c "$(curl -fsLS get.chezmoi.io)" -- init --apply takingget.chezmoi.io가 chezmoi 바이너리를~/bin에 설치taking→ GitHub 사용자명.github.com/taking/dotfiles로 자동 확장되어 clone- git 이 없으면 먼저
xcode-select --install로 설치 필요
brew install chezmoi # 또는 위 curl 스크립트
chezmoi init --apply git@github.com:taking/dotfiles.git # SSH
# 또는 https://github.com/taking/dotfiles.git # HTTPSinit --apply 한 번이 clone → 외부 플러그인 fetch → ~ 배포 → Brewfile 설치(brew bundle) 까지 수행한다.
--apply없이chezmoi init만 하면 clone 만 하고 배포는 안 한다. 배포 전에 내용을 먼저 확인하고 싶을 때:chezmoi init …→chezmoi diff→chezmoi apply.
| 목적 | 명령 |
|---|---|
| 소스 편집(에디터로 열기) | chezmoi edit ~/.zshrc |
| 실제 파일 변경을 소스에 반영 | chezmoi add ~/.config/foo |
소스 → ~ 적용 |
chezmoi apply |
| 적용 전 차이 확인 | chezmoi diff |
| 미반영 항목 확인 | chezmoi status |
| 소스 디렉토리로 이동 | chezmoi cd |
| 원격 pull + 재적용 | chezmoi update |
| 접두사/파일 | 배포 결과 | 예 |
|---|---|---|
dot_ |
. 로 시작하는 파일 |
dot_zshrc → ~/.zshrc |
private_ |
권한 0600 | private_dot_ssh/ → ~/.ssh/ |
*.tmpl |
Go 템플릿 렌더링 | run_onchange_...sh.tmpl |
run_onchange_ |
내용 해시가 바뀔 때만 실행 | Brewfile 동기화 |
.chezmoiexternal.toml |
외부 git repo/파일 fetch | zsh 플러그인 |
dot_zshrc— oh-my-zsh,ZSH_CUSTOM=~/.config/zshdot_config/zsh/—aliases,function-*,path,themes/agnoster.chezmoiexternal.toml— omz 플러그인 4종을~/.config/zsh/plugins/*로 clone (repo에 소스 미포함)dot_Brewfile+run_onchange_before_install-packages.sh.tmpl—brew bundle자동 동기화dot_kube/kubie.yaml— kubie 컨텍스트 설정dot_macos— macOS 시스템 기본값 스크립트 (자동 실행 안 됨, 아래 참고)
chezmoi apply 는 ~/.macos 파일만 배포하고 실행하지 않는다. 적용하려면 수동 실행:
sh ~/.macos # 실행 후 로그아웃/재시작 시 일부 반영2026.08 기준 일부 항목(Dashboard, iTunes 미디어키 등)은 최신 macOS에서 무효. 실행 전 내용 검토 권장.
dot_config 처럼 심링크·평문 관리가 안 되는 앱은 앱 자체 내보내기 파일을 backup/ 에 보관한다. backup/ 은 .chezmoiignore 로 배포 제외(버전 관리만, ~ 로 안 나감).
| 앱 | 왜 dot_config 불가 | 백업 방식 |
|---|---|---|
| Raycast | 설정이 ~/Library/Application Support/com.raycast.macos/ 의 암호화 SQLite(≈360MB, 수시 재기록) |
Raycast → Settings → Advanced → Export → .rayconfig(암호 보호) |
| Rectangle Pro | 앱 전용 설정 포맷 | Settings → Export → .json |
# 새 머신 복원 (수동)
# Raycast: Settings → Advanced → Import → backup/Raycast-*.rayconfig
# Rectangle: Settings → Import → backup/Rectangle*.json
backup/Raycast-2026-03-17.rayconfig는 예전 export 라 오래됨. 최신 설정은 Raycast에서 새로 Export 해 교체할 것. 자동 동기화를 원하면 Raycast Cloud Sync(Pro) — 파일 백업 불필요, 머신 간 실시간 동기화.
chezmoi 전환 이전 심링크 방식으로 되돌리려면:
# 원격에 보존된 스냅샷
git clone git@github.com:taking/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
git checkout legacy-pre-chezmoi-20260815 # 태그 (또는 legacy-dotfiles 브랜치)
./fresh.sh # 기존 부트스트랩| 참조 | 내용 |
|---|---|
태그 legacy-pre-chezmoi-20260815 |
전환 직전 스냅샷 |
브랜치 legacy-dotfiles |
동일 스냅샷 (브랜치 형태) |
브랜치 main |
현재 chezmoi 소스 |