← Back to articles

chezmoi vs GNU Stow vs Nix - Dotfile Management

Path: Computer Tech/System Configuration/Dotfile Management/chezmoi vs GNU Stow vs Nix - Dotfile Management.mdUpdated: 2/3/2026

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

ToolBest ForComplexityWhat You Have
chezmoiCross-machine configs with secretsMediumβœ… YOU USE THIS
GNU StowSimple symlink managementLow❌ Not using
NixReproducible system configurationHigh❌ 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

FeaturechezmoiGNU StowNix (Home Manager)
ComplexityMediumLowHigh
Templatingβœ…βŒβœ…
Secretsβœ…βŒβœ… (NixOps)
Multi-machineβœ…Manualβœ…
Edit in-place❌ (use chezmoi edit)βœ… (symlinks)❌ (managed by Nix)
Package managementβŒβŒβœ…
macOS supportβœ… Excellentβœ… Good⚠️ Partial
Learning curveMediumLowSteep
Version controlGit (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