$ show badele/nix-homelab
This repository is a comprehensive, declarative NixOS homelab configuration managed with the Clan framework. It defines the entire infrastructure for a multi-machine homelab including servers, desktops, and network devices, all version-controlled and reproducible. The system provisions self-hosted services (Caddy, Grafana, VictoriaMetrics, Vector, Blocky, Miniflux, Linkding, etc.), identity management (Authentik, Zitadel), monitoring and alerting, backup (Borgbackup), and desktop environments (KDE, i3). The architecture is modular: reusable NixOS feature modules under `modules/nixos/features/` follow a consistent pattern using `mkFeatureOptions` for enabling services with standardized options (domain, firewall, monitoring integration). Secrets are managed via SOPS with age encryption, and disk partitioning is handled by Disko templates. The repository is not a software application but an infrastructure-as-code project that demonstrates high craftsmanship in Nix module design, with clear separation of concerns, helper functions, and integration patterns. It is actively maintained but shows some technical drift due to deprecated identity providers and hardcoded IPs.
The LLM identified 4 files worth highlighting for reuse:
Central helper functions for the entire feature module system. Defines `mkFeatureOptions` which standardizes options for enabling features (enable, serviceDomain, openFirewall, appInfos, etc.), `mkServiceAliases` for generating bash aliases per service, and `mkGrafanaDashboardProvider` for provisioning Grafana dashboards. This pattern is highly reusable for any NixOS-based service deployment framework, allowing consistent feature toggling and integration.
A Disko template for partitioning a single disk with Btrfs subvolumes (root, home, nix, swap). This is a self-contained, parameterized Nix expression that can be reused across different machines with minimal changes (just disk device). It demonstrates a clean, declarative approach to disk layout that is idempotent and version-controlled.
A Vector configuration module for parsing CEF (Common Event Format) logs from MikroTik routers. It defines transforms for extracting fields like source IP, event type, and severity, and classifies events (login fail, port scan, DDOS, etc.). This is a reusable log processing pipeline that can be adapted to any CEF log source, demonstrating composable Vector transforms with clear labeling and risk scoring.
A NixOS module that dynamically builds a homepage dashboard aggregating all enabled features and integrations. It reads `config.homelab.features` and `config.homelab.integrations.services` to generate categorized service groups with icons, URLs, and monitoring status. The pattern of aggregating cross-module metadata into a single dashboard is reusable for any NixOS-based service catalog.