A flexible and powerful dotfiles management system that supports templating, host-specific configurations, and package-based organization.
- Template-based configuration files with variable substitution
- Host-specific package overrides
- Package-based organization of dotfiles
- Dry-run mode for safe testing
- Support for multiple package selection
- Built on GNU Stow for reliable symlink management
- GNU Stow
- BATS (Bash Automated Testing System) - for running tests
- Light-weight shell templating engine (https://github.com/arcaartem/template)
# On macOS with Homebrew
brew install stow bats
# On Ubuntu/Debian
sudo apt-get install stow bats
# Build packages (render templates) to ./tmp/build
./manage.sh build
# Render packages directly to dotfiles directory
./manage.sh render
# Preview changes (dry-run)
./manage.sh stow
# Apply changes
./manage.sh stow --apply
# Remove symlinks (dry-run)
./manage.sh unstow
# Remove and reapply symlinks (dry-run)
./manage.sh restow
# Process all available packages
./manage.sh stow --apply
# Process a single package
./manage.sh stow --apply my-package
# Process multiple packages
./manage.sh stow --apply package1 package2
# Use host-specific packages and config
./manage.sh stow --apply -H my-hostname
.
├── config/ # Configuration files
│ ├── defaults # Default template variables
│ └── hostname.conf # Host-specific template variables
├── packages/
│ ├── common/ # Common packages
│ │ └── package-name/ # Package contents
│ └── host-specific/ # Host-specific packages
│ └── hostname/ # Host-specific overrides
│ └── package-name/ # Override contents
└── src/
├── manage.sh # Main script
└── template.sh # Template processing script
Templates support variable substitution using ${VARIABLE}
syntax:
# Example template file
export PATH="${HOME}/.local/bin:${PATH}"
Variables can be defined in:
config/defaults
- Default valuesconfig/hostname.conf
- Host-specific values
# Run all tests
bats test/manage.bats
# Run specific test
bats test/manage.bats -f "test name"
Tests are written using BATS. See the existing tests in test/manage.bats
for examples.
- Create a new directory under
packages/common/
- Add your dotfiles
- Use templates with
${VARIABLE}
syntax as needed - Add host-specific overrides in
packages/host-specific/hostname/
if needed
MIT License