Introduction
Introduction to DHD
Section titled “Introduction to DHD”DHD (Declarative Home Deployment) is a modern configuration management tool that allows you to define and manage your system configuration using TypeScript. It’s designed to make setting up new machines, managing dotfiles, and maintaining consistent environments across systems both simple and reliable.
What Problems Does DHD Solve?
Section titled “What Problems Does DHD Solve?”The Setup Problem
Section titled “The Setup Problem”Setting up a new machine is often a tedious, error-prone process:
- Installing dozens of packages manually
- Copying configuration files from various sources
- Remembering all the customizations you’ve made over time
- Dealing with platform-specific differences
The Maintenance Problem
Section titled “The Maintenance Problem”Keeping multiple systems in sync is challenging:
- Dotfiles scattered across different repositories
- No clear way to track what’s installed where
- Manual updates that often get forgotten
- Configuration drift between machines
The Automation Problem
Section titled “The Automation Problem”Traditional automation tools have their own challenges:
- Complex syntax and steep learning curves
- Limited IDE support and type safety
- Platform-specific scripts that don’t transfer
- All-or-nothing execution models
How DHD Helps
Section titled “How DHD Helps”DHD addresses these problems by providing:
1. TypeScript-Based Configuration
Section titled “1. TypeScript-Based Configuration”export default defineModule("development") .description("Development environment setup") .actions([ packageInstall({ names: ["git", "nodejs", "docker"] }), gitConfig({ scope: "global", settings: { "user.name": "John Doe" } }) ]);- Full type safety and autocompletion
- Familiar syntax for developers
- Excellent IDE support
- Easy to version control
2. Declarative Approach
Section titled “2. Declarative Approach”Define the desired state, not the steps to get there:
- DHD figures out what needs to be changed
- Idempotent operations - run as many times as needed
- Clear, readable configuration files
3. Cross-Platform Support
Section titled “3. Cross-Platform Support”Write once, run anywhere:
platform.select({ macos: packageInstall({ names: ["neovim"], manager: "brew" }), linux: packageInstall({ names: ["neovim"] }), windows: packageInstall({ names: ["neovim"], manager: "scoop" })})4. Modular Organization
Section titled “4. Modular Organization”- Group related configurations into modules
- Use tags to categorize and filter
- Define dependencies between modules
- Share modules across projects
Who Is DHD For?
Section titled “Who Is DHD For?”DHD is perfect for:
- Developers who want to automate their development environment setup
- DevOps Engineers managing multiple workstations
- Teams needing consistent development environments
- Anyone tired of manual system configuration
Core Philosophy
Section titled “Core Philosophy”DHD is built on these principles:
- Simplicity First: Configuration should be easy to write and understand
- Type Safety: Catch errors at compile time, not runtime
- Cross-Platform: Your configuration should work everywhere
- Incremental Adoption: Start small and grow as needed
- Developer Experience: Great tooling and documentation matter
What’s Next?
Section titled “What’s Next?”Ready to get started with DHD?
- Install DHD on your system
- Follow the Quick Start Guide to create your first module
- Explore the Core Concepts to understand how DHD works
- Browse Examples for inspiration