A hybrid approach to managing configurations that combines the simplicity of GNU Stow with the power of Nix declarative configuration.
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
- 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 thesecrets/
directory - Automation:
justfile
provides a unified command interface for all operations
just restore [hostname]
- Complete machine setup (hostname, Nix rebuild, stow config, Homebrew)
just save
- Capture and commit all configuration changesjust configure [pkg]
- Install specific package configjust rebuild
- Apply Nix system changes
just stow [pkg] [path]
- Lift an existing config file into a stow packagejust stow-nix-file [pkg] [path]
- Lift a Nix-managed file into a stow packagejust update-brewfile
- Update Homebrew package list
just lock-vault
- Encrypt sensitive filesjust unlock-vault
- Decrypt for editing
- 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