Skip to content

dalugm/dotfiles

Repository files navigation

Dotfiles

Table of Contents

Overview

Dotfiles managed by chezmoi and just.

Quick Start

On a new machine:

# Install chezmoi first, then clone and apply
brew install chezmoi            # macOS
pacman -S chezmoi               # Arch
winget install chezmoi          # Windows

chezmoi init --apply dalugm

If you have already cloned this repo, run from the repo directory:

just init

Or manually:

chezmoi init --source ~/dotfiles --apply

Day-to-day

All commands are run from inside ~/dotfiles.

Common Workflows

Edit a config and apply it

Push to remote after applying the changes to your local machine:

# Option A: edit the source file directly, then apply
nvim dot_config/zsh/dot_zshrc
just apply

# Option B: chezmoi opens the source file for you,
# and automatically applies on exit
just edit ~/.zshrc

# Option C: edit the real file, then sync back to source
vim ~/.zshrc
just re-add                     # sync changes from ~/ back to source
just apply                      # confirm everything matches

After making changes, push to share across machines:

git add -A && git commit -m "Update …" && git push

Pull changes from another machine

just update
# Equivalent to: chezmoi update -v
# (git pull + chezmoi apply in one command)

Add a brand-new config file

# 1. Create the file in your home directory (or edit an existing one)
nvim ~/.config/newapp/config.toml

# 2. Track it with chezmoi
just add ~/.config/newapp/config.toml

# 3. Commit and push
git add -A && git commit -m "Add newapp config" && git push

Check what would change (dry run)

just diff                      # Show detailed diff of pending changes
just status                    # Summarize added/modified files

Just Recipe Reference

CommandPurpose
justList all recipes
just applyApply source changes to ~/
just diffPreview pending changes in detail
just statusSummarize pending changes
just edit ~/.fileOpen source file in $EDITOR + apply
just add ~/.fileTrack a new file from ~/
just updateGit pull + apply (sync from remote)
just cdLaunch shell in source dir
just forget ~/.fileStop managing a file
just re-addRe-add all tracked files from ~/

Directory Structure

dotfiles/
├── dot_config/            # -> ~/.config/
│   ├── zsh/               #   Zsh configs
│   │   ├── dot_zshrc      #     Main config (sourced via ~/.zshrc symlink)
│   │   ├── langs/*.zsh    #     Language-specific configs
│   │   ├── tools.zsh      #     CLI tools (mise, fzf, zoxide…)
│   │   ├── alias.zsh      #     Shell aliases
│   │   ├── function.zsh   #     Shell functions
│   │   └── completion.zsh #    Completion settings
│   ├── bash/              #   Bash configs (parallel to zsh/)
│   ├── git/config         #   Git global config
│   ├── tmux/tmux.conf     #   tmux config
│   ├── helix/             #   Helix editor config
│   └── …                  #   Other app configs
├── dot_zshenv             # -> ~/.zshenv (XDG vars, PATH)
├── dot_bunfig.toml        # -> ~/.bunfig.toml
├── dot_editorconfig       # -> ~/.editorconfig
├── dot_globalrc           # -> ~/.globalrc (GNU Global)
├── dot_ideavimrc          # -> ~/.ideavimrc
├── dot_npmrc              # -> ~/.npmrc
├── symlink_dot_zshrc      # -> ~/.zshrc -> .config/zsh/.zshrc
├── symlink_dot_bashrc     # -> ~/.bashrc -> .config/bash/.bashrc
├── justfile               # Just recipes (not managed by chezmoi)
├── nix-darwin/            # Nix-Darwin config
├── nixos/                 # NixOS config
├── vendors/               # Shared tool configs (eslint, prettier…)
└── .chezmoiignore         # Files excluded from chezmoi

Key Conventions

chezmoi Naming Rules

SourceTarget
dot_zshrc~/.zshrc
dot_config/zsh/alias.zsh~/.config/zsh/alias.zsh
dot_config/zsh/dot_zshrc~/.config/zsh/.zshrc
symlink_dot_zshrc~/.zshrc -> ~/.config/zsh/.zshrc
  • dot_ → leading dot in target path
  • dot_config/~/.config/
  • symlink_ → creates a symlink
  • Files starting with ==.== are ignored by chezmoi (use dot_ prefix inside subdirectories)

Adding a New Language Config

echo 'export MY_VAR=value' > ~/dotfiles/dot_config/zsh/langs/mylang.zsh
cp ~/dotfiles/dot_config/zsh/langs/mylang.zsh ~/dotfiles/dot_config/bash/langs/mylang.sh
chezmoi apply

No need to edit .zshrcfor f in langs/*.zsh(N) auto-loads everything.

Machine-Specific Overrides

Create .zshrc.local or .bashrc.local in ~/.config/zsh/ (or ~/.config/bash/):

# ~/.config/zsh/.zshrc.local
export GIT_AUTHOR_NAME="My Name"
export GIT_AUTHOR_EMAIL="my.email@work.com"

These files are sourced at the end of .zshrc / .bashrc but NOT managed by chezmoi.

Windows Notes

Windows-specific files (e.g. PowerShell profile) are excluded from chezmoi, manage them manually.

Acknowledgments

Inspiration and code were taken from many sources, including:

About

dotfiles

Topics

Resources

License

Stars

Watchers

Forks

Contributors