This repository contains my personal dotfiles and configuration files for various tools and applications I use daily.
This dotfiles repository uses a modular package-based architecture powered by GNU Stow. Each package is self-contained and can be installed independently, allowing you to pick only the configurations you need. The system supports cross-platform configurations (Linux/macOS), host-specific customizations, and optional tool packages.
- Modular Design: Organized into reusable packages (
common,os-*,host-*,extra-*) - XDG Base Directory Compliant: Follows modern Linux standards for config file locations
- Automated Setup: Smart setup system that installs dependencies and configures tools
- Shell Configuration Injection: Modular bash/zsh configuration via
bashrc.d/andzshrc.d/ - Cross-Platform: Supports both Linux and macOS with OS-specific overrides
- Symlink Management: Uses GNU Stow for clean, reversible installations
- Git: For cloning the repository
- GNU Stow: For symlink management
- macOS:
brew install stow - Arch Linux:
sudo pacman -S stow - Ubuntu/Debian:
sudo apt install stow
- macOS:
- Optional:
pacmanorhomebrewfor automated package installation
Use the automated install script:
curl -fsSL https://raw.githubusercontent.com/coleneville/dotfiles/main/scripts/install.sh | bash
source ~/.bashrc
dotfiles.sh setup-
Clone the repository with submodules:
git clone --recurse-submodules https://github.com/coleneville/dotfiles.git ~/.dotfiles cd ~/.dotfiles
-
Run the install script:
./scripts/install.sh
-
Reload your shell and run setup:
source ~/.bashrc # or source ~/.zshrc if using zsh dotfiles.sh setup
- Validation: Checks for required tools (git, stow)
- XDG Directories: Creates standard directories (
~/.config,~/.local/bin,~/.local/share) - Stow Packages: Symlinks all packages to your home directory
- Setup Scripts: Runs
dotfiles.sh setupto install dependencies and configure tools
The repository is organized into modular packages under packages/:
common/- Core configurations shared across all systems (git, bash, gpg)os-linux/- Linux-specific configurations and package installationsos-macos/- macOS-specific configurations and Homebrew packageshost-<hostname>/- Host-specific configurations for individual machinesextra-<tool>/- Optional tool packages (install only what you use)
Each package mirrors your home directory structure. When you "stow" a package, GNU Stow creates symlinks from the package to your home directory:
packages/common/.bashrc → ~/.bashrc
packages/common/.config/git/ → ~/.config/git/
packages/extra-nvim/.config/nvim → ~/.config/nvim
XDG Base Directory Compliance: Files are organized following modern standards:
~/.config/- Configuration files~/.local/bin/- User executables~/.local/share/- User data files~/.local/state/- State/cache files
State Tracking: Stowed packages are tracked in $XDG_DATA_HOME/stow/state for easy management.
common- Essential configs (git, bash, gpg, tmux plugins)
os-linux- Linux configurations and package installation scriptsos-macos- macOS configurations and Homebrew formulas
host-garuda-v6- Configuration for garuda-v6 machinehost-garuda-v7- Configuration for garuda-v7 machine
extra-nvim- Neovim configuration with lazy.nvimextra-old-nvim- Alternative Neovim setupextra-tmux- Tmux configuration with TPM plugin managerextra-wezterm- WezTerm terminal emulator configextra-zsh- Zsh shell with Oh My Zsh integrationextra-lazygit- Lazygit TUI configurationextra-vifm- Vifm file manager configurationextra-opencode- OpenCode editor settingsextra-work- Work-specific configurations and tools
After installation, the dotfiles.sh command is available in your $PATH (installed to ~/.local/bin/):
dotfiles.sh setup # Run all setup scriptsThis command orchestrates the installation of dependencies and configuration of tools across all stowed packages.
Each package can contribute setup scripts that run when you execute dotfiles.sh setup:
Location in packages: .local/bin/dotfiles/setup.d/XX-name.sh
How it works:
- Each package places numbered scripts in
setup.d/(e.g.,00-setup.sh,50-install.sh,99-nvim.sh) - When packages are stowed, these scripts are merged into
~/.local/bin/dotfiles/setup.d/ - Running
dotfiles.sh setupexecutes all scripts in sorted order (00-99)
Example setup scripts:
00-setup.sh(common) - Creates required directories50-install.sh(common) - Installs NVM and Node.js51-install.sh(os-linux) - Installs Linux packages via pacman99-nvim.sh(extra-nvim) - Installs Neovim dependencies99-zsh.sh(extra-zsh) - Configures Zsh and Oh My Zsh
This system allows any package to contribute shell configuration snippets that are automatically loaded in a predictable order.
Location in packages: .config/bashrc.d/XX-name.sh
The main .bashrc (from the common package) automatically sources all files from ~/.config/bashrc.d/:
export BASH_CONFIG_DIR=$HOME/.config/bashrc.d/
for rc in "$BASH_CONFIG_DIR"/*; do
if [ -f "$rc" ]; then
. "$rc"
fi
doneLocation in packages: .config/zshrc.d/XX-name.zsh
The main .zshrc (from the extra-zsh package) follows the same pattern for ~/.config/zshrc.d/:
export ZSH_CONFIG_DIR=$HOME/.config/zshrc.d/
for rc in "$ZSH_CONFIG_DIR"/*; do
if [ -f "$rc" ]; then
. "$rc"
fi
doneFiles are named with numeric prefixes to control load order:
Examples:
00-profile.sh/01-profile.zsh- XDG paths, environment variables10-functions.sh/10-functions.zsh- Shell functions20-aliases.sh/20-aliases.zsh- Command aliases99-nvim.sh/99-nvim.zsh- Tool-specific environment setup
This design means:
- The
os-linuxpackage can add Linux-specific aliases tobashrc.d/21-aliases.sh - The
extra-workpackage can add work functions tobashrc.d/12-functions.sh - The
host-garuda-v7package can add host-specific aliases tobashrc.d/22-aliases.sh - All are automatically loaded in the correct order!
Individual packages can be managed using the provided scripts:
cd ~/.dotfiles
# Install a specific package
./scripts/stow.sh extra-nvim
# Remove a specific package
./scripts/unstow.sh extra-nvim
# Install all packages
./scripts/stow-all.sh
# Remove all packages
./scripts/unstow-all.sh# After installing a new optional package
./scripts/stow.sh extra-lazygit
dotfiles.sh setup # Run setup scripts for new package
# Update configurations
cd ~/.dotfiles
git pull
git submodule update --recursive --remote
# Test a package installation (dry run)
stow -n -t "$HOME" -S extra-nvim -d packages/If you encounter conflicts when stowing:
# Use dry-run to see what would happen
stow -n -t "$HOME" -S package-name -d packages/
# If conflicts exist, backup and remove conflicting files
mv ~/.config/conflicting-file ~/.config/conflicting-file.backup
./scripts/stow.sh package-nameCheck that symlinks were created correctly:
# Verify dotfiles.sh is in PATH
which dotfiles.sh
# Check stowed packages
cat ~/.local/share/stow/state
# Verify symlinks
ls -la ~/.bashrc
ls -la ~/.config/gitIf setup scripts fail:
# Check logs from setup
dotfiles.sh setup
# Manually install missing tools
# For Arch Linux:
sudo pacman -S git stow neovim
# For macOS:
brew install git stow neovimFor detailed information on code style, conventions, and development guidelines, see AGENTS.md.
- Create package directory:
packages/your-package-name/ - Add configuration files mirroring home directory structure
- (Optional) Add setup script:
.local/bin/dotfiles/setup.d/50-your-package.sh - (Optional) Add shell config:
.config/bashrc.d/20-your-package.sh - Test:
./scripts/stow.sh your-package-name
# Validate shell script syntax
bash -n scripts/your-script.sh
# Test stow in dry-run mode
stow -n -t "$HOME" -S package-name -d packages/
# Verify symlinks
ls -la ~/path/to/expected/symlinkPersonal dotfiles repository. Feel free to use as inspiration for your own configurations.