Skip to content

A pragmatic dotfiles manager that combines GNU Stow simplicity with Nix reproducibility for the best of both worlds

Notifications You must be signed in to change notification settings

expelledboy/dotfiles

Repository files navigation

Dotfiles: The Best of Both Worlds

A hybrid approach to managing configurations that combines the simplicity of GNU Stow with the power of Nix declarative configuration.

Why This Approach?

Traditional dotfiles management presents a dilemma:

  • Pure symlink management (Stow) is simple but can't handle dependencies
  • Pure declarative configuration (Nix) is powerful but complex for simple files

This system takes the best of both worlds:

  • Stow for what it does best: transparent file management
  • Nix for what it does best: reproducible environments
  • Automation to tie it all together seamlessly

How It Works

  • Directory Structure: Each top-level directory is a stow package (e.g., nvim/, kitty/)
  • Configuration: Config files are stored in their natural paths within each package
  • Integration: Each package can have a home.nix for declarative dependencies
  • Environment: .env.user and .env.config define paths and preferences
  • Security: git-crypt encrypts sensitive files in the secrets/ directory
  • Automation: justfile provides a unified command interface for all operations

Workflows

Setup

  • just restore [hostname] - Complete machine setup (hostname, Nix rebuild, stow config, Homebrew)

Daily Use

  • just save - Capture and commit all configuration changes
  • just configure [pkg] - Install specific package config
  • just rebuild - Apply Nix system changes

Extending

  • just stow [pkg] [path] - Lift an existing config file into a stow package
  • just stow-nix-file [pkg] [path] - Lift a Nix-managed file into a stow package
  • just update-brewfile - Update Homebrew package list

Security

  • just lock-vault - Encrypt sensitive files
  • just unlock-vault - Decrypt for editing

Key Benefits

  • Progressive adoption: Start simple, add complexity only where needed
  • Self-documenting: Directory structure documents what's configured
  • Future-proof: Nix provides reproducibility, Stow provides simplicity
  • Flexible: Works for both quick configs and complex environments

About

A pragmatic dotfiles manager that combines GNU Stow simplicity with Nix reproducibility for the best of both worlds

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published