Skip to content

Repository files navigation

English | 简体中文

My Dotfiles

Note

This repository contains my dotfiles for managing my development environment. Powered by chezmoi, it allows me to effortlessly keep my configurations in sync across multiple Macs.

Project Overview

This repository contains a series of configuration files and scripts used to set up and manage my development environment, including but not limited to:

These files are managed using chezmoi, with support for templates, encryption, and per-device customization.

Installation Instructions

One-command setup on a new machine

On a new Apple Silicon Mac, open Terminal.app and run:

sh -c "$(curl -fsLS get.chezmoi.io)" -- init --apply liby

This is a single entry point, not an unattended install. Keep Terminal.app open for private template prompts, Xcode or sudo interaction, and YubiKey access.

This command will:

  1. Install chezmoi
  2. Clone this repository to ~/.local/share/chezmoi
  3. Run all bootstrap scripts (installing Xcode CLI Tools, Homebrew, brew packages, etc.)
  4. Sync configuration files to $HOME

On a machine with chezmoi already installed

chezmoi init liby
chezmoi apply

Usage

chezmoi add <file>          # Add a file to chezmoi management
chezmoi edit <file>         # Edit the source file
chezmoi status --exclude=encrypted  # Show a safe change overview
chezmoi diff <dest-path>    # Inspect one non-secret target
chezmoi apply               # Apply all changes to $HOME
chezmoi cd                  # Enter the source directory
chezmoi git status          # Run Git commands on the source directory from anywhere

Encrypted files

Sensitive files are stored with GPG encryption:

chezmoi add --encrypt <file>   # Add with encryption

Bootstrap scripts

Bootstrap scripts are located in .chezmoiscripts/ and run in listed order:

Phase Script Notes
before Xcode CLI Tools Required for Git and compilation
before Homebrew
before Brewfile packages Recreates a daily Homebrew update, upgrade, and cleanup LaunchAgent
before GPG agent Fetches the YubiKey public key before encrypted targets are synchronized
before Case-sensitive volume Creates and persistently mounts the ~/Code APFS volume
before Node.js Via proto; includes pnpm
before Global developer tools Global npm tool and Pyright versions declared in package.json and requirements.txt
before Rust
before Claude Code
after Git config Regenerates provider configs when rendered inputs change and resolves signing keys from GPG/YubiKey at runtime
after macOS defaults
after zsh completions
after Envchain seed Seeds user-managed encrypted values into Keychain namespaces

before scripts run before file sync, after scripts run after file sync.

Homebrew autoupdate is a periodic LaunchAgent, so its process does not need to remain active between runs. brew autoupdate status checks the caller's bootstrap namespace and may report stopped from another app even while the Terminal-installed agent is loaded. Verify the durable GUI-domain state with:

launchctl print "gui/$(id -u)/com.github.domt4.homebrew-autoupdate"

The case-sensitive volume step uses Python's plist parser to find the APFS container that stores $HOME, installs an exact UUID mount through vifs, and refuses to cover a non-empty ~/Code or automatically unmount a volume from another path. If it fails, resolve the reported conflict and rerun chezmoi apply; a failed run_once is retried, but a successful run does not reconcile later drift. Its disk-free checks are:

/usr/bin/python3 .github/tests/setup_case_sensitive_volume_test.py

Docker cannot validate macOS APFS or Disk Arbitration. Fresh-machine acceptance still requires apply, a reboot, confirmation that the same volume is mounted at ~/Code, and a second no-op apply.

Renovate checks daily in the Asia/Singapore timezone and batches routine updates from every dependency manager, including major updates, into one All dependencies PR. Path-scoped CI validates the dependency surfaces changed by that PR. The next chezmoi apply installs only missing or mismatched global npm tools and Pyright versions.

Zsh plugins are pinned to upstream commits in .chezmoiexternal.toml. CI verifies that each pinned archive applies and its entry point loads.

Contribution Guidelines

If you have any suggestions or issues, feel free to open an Issue or Pull Request.

About

✨ Dotfiles for humans and their coding agents

Resources

Stars

112 stars

Watchers

2 watching

Forks

Contributors

Languages