chezmoi vs GNU Stow vs Nix - Dotfile Management
chezmoi vs GNU Stow vs Nix: Dotfile Management
The confusion: There are multiple ways to manage dotfiles (config files). They solve overlapping but different problems.
TL;DR Decision Matrix
| Tool | Best For | Complexity | What You Have |
|---|---|---|---|
| chezmoi | Cross-machine configs with secrets | Medium | β YOU USE THIS |
| GNU Stow | Simple symlink management | Low | β Not using |
| Nix | Reproducible system configuration | High | β Not using |
Recommendation: Stick with chezmoi. You're already using it effectively.
The Three Approaches
1. chezmoi (What You're Using)
What it is: Sophisticated dotfile manager with templating and secret management
Philosophy: "Your dotfiles should work across multiple machines with different requirements"
How it works:
bash~/.local/share/chezmoi/ # Source (Git repo) βββ dot_zshrc # Template βββ .chezmoidata.toml # Machine-specific data βββ ... chezmoi apply β ~/ # Target (actual files) βββ .zshrc # Generated from template βββ ...
Key features:
- β Templates (different configs per machine)
- β Secret management (1Password, encrypted files)
- β Scripts (run commands on apply)
- β Cross-platform (Windows, macOS, Linux)
- β Works with ANY file structure
Example template:
bash# ~/.local/share/chezmoi/dot_zshrc.tmpl {{ if eq .chezmoi.os "darwin" }} export HOMEBREW_PREFIX="/opt/homebrew" {{ else }} export HOMEBREW_PREFIX="/usr/local" {{ end }}
When chezmoi shines:
- Multiple machines (work laptop, personal laptop, server)
- Secrets (API keys, credentials)
- Machine-specific configs (different monitor setups, etc.)
2. GNU Stow
What it is: Simple symlink farm manager (originally for software installation)
Philosophy: "Just symlink files from a central directory"
How it works:
bash~/dotfiles/ # Source (Git repo) βββ zsh/ β βββ .zshrc # Actual file βββ nvim/ β βββ .config/nvim/... βββ ... stow zsh β ~/ # Target (symlinks) βββ .zshrc β ~/dotfiles/zsh/.zshrc
Key features:
- β Dead simple (just creates symlinks)
- β Transparent (edit file in-place, changes reflected in Git)
- β No special syntax (plain files)
Limitations:
- β No templating (same config everywhere)
- β No secret management
- β No machine-specific handling
- β Symlinks can break tools that check file types
When Stow shines:
- One machine (or identical machines)
- Simple dotfiles (no secrets, no templates)
- You want to edit files directly without
chezmoi edit
3. Nix (NixOS / Home Manager)
What it is: Declarative system and package manager
Philosophy: "Describe your ENTIRE system in code, make it reproducible"
How it works:
nix# ~/.config/home-manager/home.nix { config, pkgs, ... }: { home.packages = with pkgs; [ neovim ripgrep fzf ]; programs.zsh = { enable = true; shellAliases = { ll = "ls -la"; }; }; }
Key features:
- β Reproducible (exact same system anywhere)
- β Declarative (describe desired state, Nix figures out how)
- β Atomic updates (rollback if something breaks)
- β Package + config management (not just dotfiles!)
Limitations:
- β Steep learning curve (new language, new concepts)
- β Nix ecosystem only (works best on NixOS)
- β Overkill for just dotfiles
- β macOS support is incomplete
When Nix shines:
- You want reproducible SYSTEMS (not just configs)
- You're willing to learn a functional language
- You use Linux (NixOS especially)
- You want to manage packages + configs together
Side-by-Side Comparison
| Feature | chezmoi | GNU Stow | Nix (Home Manager) |
|---|---|---|---|
| Complexity | Medium | Low | High |
| Templating | β | β | β |
| Secrets | β | β | β (NixOps) |
| Multi-machine | β | Manual | β |
| Edit in-place | β (use chezmoi edit) | β (symlinks) | β (managed by Nix) |
| Package management | β | β | β |
| macOS support | β Excellent | β Good | β οΈ Partial |
| Learning curve | Medium | Low | Steep |
| Version control | Git (manual) | Git (manual) | Git (manual) |
What You're Doing with chezmoi
Your setup:
bash~/Code/github.com/theslyprofessor/chezmoi/ # Git repo βββ library/Application Support/ # macOS app configs β βββ com.mitchellh.ghostty/config βββ ... chezmoi managed files: ~/Library/Application Support/com.mitchellh.ghostty/config ~/.zshrc (likely)
Why this is good:
- β Can have different Ghostty configs per machine
- β Can template for work vs personal
- β Can manage secrets (if needed)
- β Works cross-platform
Common Workflows
chezmoi Workflow (What you do now)
bash# Edit config chezmoi edit ~/.zshrc # See what would change chezmoi diff # Apply changes chezmoi apply # Commit to Git cd ~/.local/share/chezmoi git add . git commit -m "Update zshrc" git push
GNU Stow Workflow (Alternative)
bash# Edit config (directly in Git repo) nvim ~/dotfiles/zsh/.zshrc # Symlink is already there, changes are live! # Commit to Git cd ~/dotfiles git add . git commit -m "Update zshrc" git push
Nix Workflow (Different beast)
bash# Edit Nix config nvim ~/.config/home-manager/home.nix # Apply changes (builds + installs packages + configs) home-manager switch # Commit to Git cd ~/.config/home-manager git add . git commit -m "Update config" git push
Why chezmoi vs GNU Stow?
chezmoi is better when:
- You have secrets (API keys, tokens)
- You have multiple machines with different needs
- You want templates (e.g., different monitor configs)
GNU Stow is better when:
- You have one machine (or identical machines)
- You want simplicity (no templates, just files)
- You prefer editing files directly
Your use case (multiple machines, potential secrets) β chezmoi is correct choice
Why NOT Nix?
Nix is a different category: It's not just dotfile management - it's SYSTEM management.
Use Nix if:
- You want to manage packages + configs together
- You want reproducible systems
- You're willing to learn a new language
- You use Linux (especially NixOS)
Don't use Nix if:
- You just want dotfile sync (chezmoi/Stow are simpler)
- You're on macOS (partial support, rough edges)
- You don't want to learn functional programming
Hybrid Approaches
You can combine these!
chezmoi + shell-config (What you're doing)
bash~/Code/github.com/theslyprofessor/shell-config/ # Simple Git repo βββ zsh/ βββ init.zsh βββ aliases.zsh βββ environment.zsh ~/.zshrc # Managed by chezmoi, sources shell-config
Why this works:
- β
chezmoi handles machine-specific
.zshrc - β shell-config is simple, version-controlled, no templates needed
- β Best of both worlds
Stow + chezmoi (Common pattern)
bash# Use Stow for simple configs (nvim, tmux) ~/dotfiles/nvim/ β ~/.config/nvim/ # Use chezmoi for machine-specific configs (.zshrc, secrets) chezmoi manages ~/.zshrc (templated)
Should You Switch?
To GNU Stow: β No
- You're already using chezmoi effectively
- You DO have multi-machine needs (home, work, servers?)
- Stow doesn't add anything you need
To Nix: β Not for dotfiles alone
- Huge learning curve
- macOS support is incomplete
- Only worth it if you want full system management
Stick with chezmoi: β Yes
- You're using it correctly
- It handles your use case well
- Adding complexity (Stow/Nix) doesn't help
Summary
What you have:
- β chezmoi for machine-specific configs
- β shell-config Git repo for shared shell configs
- β This is a smart hybrid approach!
What you should do:
- β Keep using chezmoi
- β Keep shell-config separate (simpler)
- β Don't overthink it - your setup works!
When to reconsider:
- If you only have one machine β Consider Stow (simpler)
- If you want reproducible Linux systems β Consider Nix (big commitment)
- Otherwise β Stick with chezmoi
Related Articles
- Dotfile Management Strategies - Best practices
- Version Control Workflows - Git for configs
Links
Official Documentation
- chezmoi: https://www.chezmoi.io/
- GNU Stow: https://www.gnu.org/software/stow/
- Nix (Home Manager): https://github.com/nix-community/home-manager
- Comparison: https://dotfiles.github.io/utilities/