My dotfiles for work at Sun*
PhDoanh's dotfiles managed by chezmoi - targeting macOS and Ubuntu Linux (includes WSL2), with Sun* work-machine awareness and Docker support.
| Component | chezmoi Source File | Destination | Description |
|---|---|---|---|
| Zsh config | dot_zshrc.tmpl |
~/.zshrc |
Shell entrypoint; loads Oh My Zsh, Powerlevel10k, rbenv, opencode, aliases & secrets |
| Zsh aliases | dot_zsh_aliases.tmpl |
~/.zsh_aliases |
Navigation helpers, Docker/Compose shortcuts, universal package manager (p), search & grep utils |
| Zsh secrets | encrypted_dot_zsh_secrets.age |
~/.zsh_secrets |
Age-encrypted secrets file (sourced in .zshrc) |
| Powerlevel10k config | dot_p10k.zsh |
~/.p10k.zsh |
Full Powerlevel10k prompt configuration |
| Git config | dot_gitconfig.tmpl |
~/.gitconfig |
Global git config with conditional include for personal/work identity |
| Git config – personal | create_dot_gitconfig-personal.tmpl |
~/.gitconfig-personal |
Personal git identity override (applied in ~/projects/) |
| Git config – work | create_dot_gitconfig-work.tmpl |
~/.gitconfig-work |
Sun* work git identity (applied in ~/projects/sun-asterisk/) |
| Gem config | dot_gemrc |
~/.gemrc |
RubyGems global settings |
| chezmoi config template | .chezmoi.toml.tmpl |
~/.config/chezmoi/chezmoi.toml |
chezmoi config: age encryption, VSCode as editor/diff/merge tool, auto-commit & push |
| External resources | .chezmoiexternal.toml.tmpl |
(managed by chezmoi) | Downloads Oh My Zsh, Powerlevel10k, zsh plugins, MesloLGS NF fonts; also gh, uv, opencode, lazygit on Linux |
| Age private key (encrypted) | key.txt.age |
~/.config/chezmoi/key.txt (decrypted) |
Age private key used to decrypt secrets; itself encrypted with a passphrase |
| Oh My Zsh | (external) | ~/.oh-my-zsh |
Shell framework, pulled from GitHub archive |
| zsh-syntax-highlighting | (external) | ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting |
Syntax highlighting plugin for Zsh |
| zsh-autosuggestions | (external) | ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions |
Fish-like autosuggestions for Zsh |
| Powerlevel10k theme | (external) | ~/.oh-my-zsh/custom/themes/powerlevel10k |
Fast, feature-rich Zsh theme |
| MesloLGS NF fonts | (external, non-headless only) | ~/.local/share/fonts/ (Linux) / ~/Library/Fonts/ (macOS) |
Nerd Font required for Powerlevel10k icons |
| gh CLI | (external, Linux only) | ~/.local/bin/gh |
GitHub CLI (latest release) |
| uv | (external, Linux only) | ~/.local/bin/uv |
Extremely fast Python package manager |
| opencode | (external, Linux only) | ~/.opencode/bin/opencode |
AI coding agent CLI |
| lazygit | (external, Linux only) | ~/.local/bin/lazygit |
Terminal UI for git |
| File | Purpose |
|---|---|
packages.toml |
System package lists for Linux (apt) and macOS (brew) — system, Rails build deps, Node.js, MySQL |
versions.toml |
Pinned versions: Ruby 3.3.11, Rails 8.1.3 |
public-pii.toml |
Non-secret personal/work email addresses used in git config templates |
| Script | When | Action |
|---|---|---|
run_onchange_before_00-decrypt-private-key.sh.tmpl |
Before apply | Decrypts key.txt.age → ~/.config/chezmoi/key.txt using a passphrase |
run_onchange_before_10-install-sys-packages.sh.tmpl |
Before apply | Installs system packages via apt-get / brew |
run_onchange_before_20-install-rbenv.sh.tmpl |
Before apply | Installs rbenv |
run_onchange_before_30-install-ruby.sh.tmpl |
Before apply | Installs Ruby 3.3.11 via rbenv |
run_onchange_before_40-install-rails.sh.tmpl |
Before apply | Installs Rails 8.1.3 and build dependencies |
run_onchange_before_50-install-nodejs-yarn.sh.tmpl |
Before apply | Installs Node.js + Yarn via nvm or brew |
run_onchange_before_60-install-mysql.sh.tmpl |
Before apply | Installs MySQL server/client |
run_onchange_before_70-install-vscode.sh.tmpl |
Before apply | Installs VS Code (full GUI on non-headless, CLI-only on headless/ephemeral) |
Before running the initial setup, ensure the following are available on your machine:
- Ubuntu Linux or macOS: Scripts are conditioned on
linux-ubuntuanddarwin; other distros are not supported - Docker: Required only if you want to use the Docker-based setup (Option B). Ensure Docker is installed and running.
- WSL2: Required only if you are Windows user - install via
wsl --install(all below operations are same to linux-ubuntu)
Step 1: Install chezmoi and apply dotfiles in one command
sh -c "$(curl -fsLS get.chezmoi.io)" -- init --apply PhDoanh/dotfilesThis will:
- Download and install chezmoi to
~/.local/bin - Clone this repo to
~/.local/share/chezmoi - Prompt you: "Is this a Sun* work machine?" — answer
yorn - Run all
run_onchange_before_*scripts in order (decrypt key → install packages → rbenv → Ruby → Rails → Node.js → MySQL → VSCode) - Apply all dotfiles to your home directory
Step 2: Reload the shell
exec zsh # or `chsh -s $(which zsh)` to set Zsh as default shellNote: The age passphrase for
key.txt.agewill be prompted during step 4. Keep it ready.
chezmoi provides native docker run subcommands. That pulls a base image, creates a container, installs chezmoi inside it, runs chezmoi init --apply, then drops you into a shell — all in one command.
chezmoi docker run -p apt-get ubuntu:latest PhDoanh/dotfiles
⚠️ On Docker (ephemeral/headless mode), the scripts automatically detectCODESPACES,REMOTE_CONTAINERS_IPC, orroot/ubuntu/vscodeusernames and setisEphemeral=trueandisHeadless=true. This means:
- VS Code is installed in CLI-only mode (not full GUI)
- MesloLGS NF fonts are not installed