Introduction
This homelab provides a comprehensive collection of reusable NixOS modules organized into three main categories:- Core - Essential system configuration (boot, networking, secrets, users)
- Desktop - Desktop environment and features
- Hosting - Single-node and clustering infrastructure
Module Structure
Modules are located inmodules/nixos/ and follow a hierarchical structure:
Using Modules
Modules are imported automatically when you use the homelab flake. Simply enable them in your system configuration:Module Categories
Core Modules
Core modules provide essential system functionality:- Boot - Systemd-boot, ZRAM swap, Plymouth, secure boot
- GitOps - Automated system updates from Git repositories
- Hardware - GPU, Bluetooth, HID device support
- Networking - Network Manager, Tailscale, OpenSSH
- Secrets - SOPS-based secret management
- Users - Declarative user management with home-manager integration
- ClamAV - Antivirus scanning and protection
Desktop Modules
Desktop modules configure graphical environments:- Environments - KDE Plasma, COSMIC desktop
- Display Managers - SDDM, greetd
- Window Managers - Hyprland with UWSM
- Features - Gaming, printing, virtualization
- Services - PipeWire, Flatpak, ASUS laptop tools
Hosting Modules
Hosting modules enable container and cluster orchestration:- Single-Node - Docker-based container hosting with Traefik reverse proxy
- Clustering - K3s Kubernetes clusters with multi-node support
Configuration Patterns
Basic System Configuration
A minimal desktop system:Server with Container Hosting
A server with Docker and Tailscale:Multi-Node Kubernetes Cluster
K3s leader node:Module Development
Creating a New Module
Modules follow the standard NixOS module pattern:Best Practices
- Use enable options - Every module should have an
enableoption - Provide defaults - Sensible defaults reduce configuration burden
- Add examples - Show real-world usage in option descriptions
- Document options - Clear descriptions for all configurable options
- Use assertions - Validate incompatible option combinations
- Integrate with home-manager - Extend user configurations when appropriate
Next Steps
- Core Module Reference - Detailed core module documentation
- Desktop Module Reference - Desktop environment options
- Hosting Module Reference - Container and cluster setup
- System Configuration - Real-world system configurations