a dotfile repository using XDG Base Directory Specification to compartmentalize shell configuration. Requires GNU
stow, Homebrew andgit. Uses the amazingmiseto create environments for various programming languages.
This repo's .zshenv changes zsh's config to the following
export ZDOTDIR=$HOME/.config/zsh-
Install
homebrew/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -
Install dependencies
gitandstowbrew install git stow
-
On Github click 'Use this template' or fork repo.
-
In your new repo, change git user name and email in
.config/git/config -
Clone your new repo from your $HOME directory
git clone https://github.com/<GITHUB_USER_NAME>/.file.git
-
Run
stowfrom $HOME/.file, to symlink config filescd $HOME/.file
stow . -
Source
.zshrcor open new terminalsource $HOME/.config/zsh/.zshrc
or use this repo's alias to reload zsh's config
sz
-
Install
brewpackagesbrew bundle install --no-upgrade
init.sh exports the following XDG spec environment variables, other init.sh files in .config/ depend on these variables as well.
Some tools an init.sh file to setup aliases, run commands, environment variables, etc.
export XDG_CONFIG_HOME=$HOME/.config
export XDG_CACHE_HOME=$HOME/.cache
export XDG_DATA_HOME=$HOME/.local/share
export XDG_STATE_HOME=$HOME/.local/state
export XDG_RUNTIME_DIR="/tmp/${UID}-runtime-dir/".config/git - user's git config
Install brew packages and casks .config/homebrew/Brewfile
brew bundle install --no-upgradeor to upgrade to latest versions, drop the --no-upgrade
brew bundle installinstall is also optional
brew bundle.config/homebrew - contains a list of applications to be installed and locked versions
Update .config/homebrew/Brewfile with currently installed packages
brew bundle dump --force.stow-local-ignore
gnu stow to symlink the contents of the folder in a user's $HOME (~) folder by default.
common commands - https://mise.jdx.dev/dev-tools/#common-commands
xdg-ninja is a script that checks for any files or directories in the home directory that do not follow the XDG Base Directory Specification.
xdg-ninjaThe .stow-local-ignore file tells GNU Stow which files and directories to exclude when creating symlinks. Current exclusions:
.DS_Store- macOS metadata files.git- Git repository data.gitmodules- Git submodule configuration.gitignore- Git ignore patterns.stowrc- Stow configuration filesreadme.md- This documentation file/CLAUDE.md- Claude AI instructions (repository root only)^/[^/]*\.sh$- Shell scripts in repository root
# Symlink configurations using stow (run from repo root)
stow .
# Reload zsh configuration
sz # alias for sourcing .zshrc
# Install Homebrew packages (without upgrades)
brew bundle install --no-upgrade
# Install Homebrew packages with upgrades
brew bundle install
# Update Brewfile with currently installed packages
brew bundle dump --force# Mise commands for language version management
mise install # Install all tools from config.toml
mise use node@20 # Use specific version locally
mise list # List installed tools
mise outdated # Check for updates# Find dangling symlinks recursively
symlinks -vr ~/.config | grep dangling
# Clean up broken symlinks (be careful)
symlinks -dr ~/.configinit.sh- Main bootstrap script that sets XDG variables and loads all configurationsalias.sh- Global shell aliases.zshenv- ExportsZDOTDIR=$HOME/.config/zshto redirect zsh configuration.config/git/config- Git configuration and aliases for git and git-lfs.config/*/init.sh- Tool-specific initialization scripts.config/homebrew/Brewfile- Package management definitions.config/mise/config.toml- Programming language versions and packages.stow-local-ignore- Files/patterns to exclude from stowing
- XDG Base Directory Structure: All configurations follow XDG spec with files organized under
.config/ - Modular Initialization: Each tool has its own
init.shfile in.config/[tool]/that sets up environment variables and configurations - Central Bootstrap: Main
init.shloads all tool-specific configurations and the globalalias.sh - Symlink Management: GNU
stowcreates symlinks from this repo to$HOMEdirectory
The repository manages versions for:
- Node.js (v22)
- Python (3.11)
- Java (Oracle GraalVM)
- Rust (stable)
- Deno (2.3.7)
- Clojure, Bun, and various CLI tools
- Repository location flexibility: The
.stowrcfile (--target=$HOME) allows this repository to be placed anywhere on your system - Run
stow .from the repository directory (wherever you cloned it) - Brewfile contains both CLI tools and GUI applications
- Each tool's configuration is self-contained in its
.config/subdirectory - The
.zshenvfile in this repository exports the critical variable that redirects zsh to use XDG-compliant paths
Recursively delete dangling symlinks
symlinks -dvr ~/.config | grep dangling