Core principles
The configuration follows these architectural principles:Modularity
Configuration is split into small, focused modules that can be composed together
Cross-platform
Supports NixOS, macOS (nix-darwin), WSL2, and ISO images from a single codebase
Type safety
Uses Nix’s module system with type-checked options for reliable configuration
Reusability
Shared modules work across different system classes, reducing duplication
Architectural layers
The configuration is organized into three distinct layers:1. Flake layer
The top-levelflake.nix defines inputs and delegates to flake-parts:
modules/flake/ directory contains flake-parts modules that generate outputs:
- args.nix - Base arguments passed to all systems
- checks/ - Custom validation checks
- lib/ - Shared library functions
- packages/ - Custom packages provided by the flake
- programs/ - Development shell programs
2. System definitions
Thesystems/ directory contains per-host configurations using easy-hosts:
systems/ with host-specific configuration.
3. Module layer
Themodules/ directory contains reusable configuration modules organized by system class. This is covered in detail in the Modules page.
Configuration flow
Here’s how configuration flows through the system:The garden namespace
All custom options are namespaced undergarden.* to avoid conflicts:
The
garden namespace was chosen to represent a carefully cultivated configuration that grows over time.System classes
The framework supports multiple system classes:nixos - NixOS systems
nixos - NixOS systems
Full NixOS configurations for desktops, laptops, and servers. Includes all base modules plus NixOS-specific modules for boot, hardware, networking, and services.Module path:
modules/nixos/darwin - macOS systems
darwin - macOS systems
macOS configurations using nix-darwin. Includes base modules plus Darwin-specific modules for Homebrew, preferences, and macOS-specific settings.Module path:
modules/darwin/wsl - WSL2 instances
wsl - WSL2 instances
NixOS on WSL2 configurations. Treated as a nixos subclass with WSL-specific modules.Module path:
modules/wsl/iso - Installation images
iso - Installation images
Bootable ISO images for installing NixOS. Used for system installation and recovery.Module path:
modules/iso/home - Home Manager (internal)
home - Home Manager (internal)
Home Manager configurations are imported by base modules and share the same
garden namespace.Module path: modules/home/Integration with home-manager
Home Manager is integrated at the base level, meaning user environment configuration is part of system configuration:- Home Manager modules are imported by
modules/base/default.nix - User-specific settings use the same
garden.*options - Home Manager and system configuration share the same module system
Next steps
Module system
Learn how modules are organized and how to create new ones
System definitions
Understand how to configure individual hosts