What flake modules provide
Flake modules operate at the flake level and configure how your entire system is built and tested. Unlike other module categories that configure system or user settings, flake modules define the infrastructure that makes everything else work.Build configuration
System architecture support, package overlays, and build arguments
Development tools
Dev shells with formatters, linters, and development dependencies
Custom packages
Framework-specific packages like documentation generators and installers
Library functions
Helper functions for secrets, hardware detection, and configuration templates
Module structure
Flake modules are organized into several subcategories:args.nix - Build arguments
args.nix - Build arguments
Defines the base arguments passed to the flake, including supported systems and nixpkgs configuration.This configuration:
modules/flake/args.nix
- Supports x86_64 and ARM Linux systems
- Supports Apple Silicon Macs (aarch64-darwin)
- Enables unfree packages like proprietary software
- Allows building for unsupported systems when needed
lib/ - Library functions
lib/ - Library functions
Custom library functions that extend NixOS capabilities throughout the framework.Available libraries:Example: SSH public keys
helpers.nix- File import utilities, git URL helpers, SSH key managementsecrets.nix- Secrets management with sops-nix integrationservices.nix- Service configuration helpershardware.nix- Hardware detection and configurationvalidators.nix- Input validation functionstemplate/- XDG directory templates and configuration scaffolding
checks/ - Automated checks
checks/ - Automated checks
CI/CD checks that validate your configuration before deployment.Available checks:
formatting.nix- Ensures code is properly formattedlib.nix- Tests library functions
packages/ - Custom packages
packages/ - Custom packages
Framework-specific packages that extend NixOS functionality.Available packages:
docs/- Documentation generation system (this documentation!)iztaller/- Installation wizard and system bootstrapper
programs/ - Development environment
programs/ - Development environment
Programs and tools for the development shell.Available programs:
formatter.nix- Code formatting with nixfmt, keep-sorted, treefmtshell.nix- Development shell with build tools and utilities
nix develop in your configuration directory.Usage example
Flake modules are imported automatically when you use the flake. You don’t typically interact with them directly unless you’re extending the framework.flake.nix
Key features
Multi-architecture support
The flake supports building for multiple architectures out of the box:x86_64-linux- Standard Intel/AMD Linux systemsaarch64-linux- ARM Linux systems (Raspberry Pi, cloud ARM instances)aarch64-darwin- Apple Silicon Macs
Development shell
Enter the development environment to access all build tools:- Code formatters (nixfmt, prettier, keep-sorted)
- Build tools (git, just, direnv)
- Documentation generators
- Testing utilities
Custom library functions
The framework provides dozens of helper functions that simplify common NixOS configuration tasks. These are available throughout your configuration aslib.garden.*.
Next steps
NixOS modules
System-level configuration for NixOS
Base modules
Shared configuration between NixOS and Darwin