How hugo-berendi/yomi works
This repository is a sophisticated Nix configuration collection that manages both system-wide (NixOS) and per-user (home-manager) setups for multiple hosts. In essence, it is a declarative configuration repository for a homelab and personal systems based on Nix, aimed at automating and versioning every bit of a computer’s configuration—from low‐level system settings to user applications (like Neovim, Tmux, and window-manager settings), DNS configurations, and even homelab services.
Overall Structure
• At the highest level, show a “Flake” component (flake.nix) as the entry point. This is the core that ties together the declarative configurations.
• Split the project into major domains: system-level (NixOS) configurations and user-level (home-manager) configurations.
• Areas for common/shared configuration and tools.
Break Down the Key Components
• Common Configurations (Directory: common)
• Hosts Configurations (Directory: hosts/nixos)
– Contains host-specific configurations for different machines (e.g., amaterasu, tsukuyomi).
– Highlight the structure for file systems, hardware definitions, and services.
• Home Manager Configurations (Directory: home)
– Separates per-user configurations into feature folders (e.g., cli, desktop, neovim, wayland).
– Shows customization for desktop apps, terminal configurations, and application-specific setup.
• Modules (Directory: modules)
– Contains custom modules for both NixOS and home-manager that are reused throughout.
• Devshells (Directory: devshells)
– A set of preconfigured Nix shells for languages (Haskell, Lua, Typescript, etc.) representing development environments.
• Overlays (Directory: overlays) and Packages (Directory: pkgs)
– Overlays modify/default packages and supplementary Nix packages.
• DNS and Scripts (Directories: dns, scripts)
– DNS directory holds configurations for domain management and DNS-related Nix modules.
– Scripts include utility and operational bash scripts for tasks such as building ISOs, managing keys, and other systems operations.
Relationships and Data Flow
• The Flake component is the centralized orchestrator that pulls in the common configurations, overlays, modules, and host/home-manager-specific files.
– From the Flake entry point to both the “Hosts” and “Home” configurations.
– From the “Common” folder into each of these main areas to indicate shared resources.
– Show how “Modules” are consumed by both system-level configurations and home-manager settings.
– Indicate that “Overlays” affect the package resolutions inside “pkgs”.
– Represent “Scripts” as auxiliary tools that interact with these configurations (for building, deployment, or management).
Architectural Patterns
• Separation of Concerns: Distinct directories and configurations for system vs. user vs. development tooling.
• Modularity and Reusability: Use of modules, overlays, and common configurations to avoid duplication.
• Declarative System Management: The entire setup is built with declarative paradigms using NixOS for system management and home-manager for user configuration.
• Host-Based Customization: The project leverages a host-oriented structure (e.g., “amaterasu”, “tsukuyomi”) to allow tailor-made settings per device.