# hugo-berendi/yomi architecture

> Architecture diagram of the GitHub repository hugo-berendi/yomi, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hugo-berendi/yomi
- Repository: https://github.com/hugo-berendi/yomi

## Overview

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.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["Flake Entry Point"]:::flake
    B["Common Configurations"]:::shared
    C["NixOS Hosts Configurations"]:::system
    D["Home Manager Configurations"]:::user
    E["Custom Modules"]:::modules
    F["Overlays"]:::tools
    G["Supplementary Packages"]:::tools
    H["Devshells"]:::tools
    I["Developer Environment"]:::tools
    J["DNS Configurations"]:::tools
    K["Utility Scripts"]:::tools

    %% Flake orchestrates overall configurations
    A -->|"orchestrates"| B
    A -->|"orchestrates"| C
    A -->|"orchestrates"| D
    A -->|"includes"| E
    A -->|"includes"| F
    A -->|"configures"| J

    %% Common configurations shared by both system and user domains
    B -->|"shared"| C
    B -->|"shared"| D

    %% Custom modules are consumed by both NixOS and Home Manager setups
    E -->|"used_by"| C
    E -->|"used_by"| D

    %% Overlays affect package resolutions inside Supplementary Packages
    F -->|"modifies"| G

    %% Devshells supply development environments
    H -->|"supports"| I

    %% Utility scripts assist in configuration management
    K -->|"assists"| A
    K -->|"assists"| C
    K -->|"assists"| D

    %% Click Events
    click A "https://github.com/hugo-berendi/yomi/blob/main/flake.nix"
    click B "https://github.com/hugo-berendi/yomi/tree/main/common/"
    click C "https://github.com/hugo-berendi/yomi/tree/main/hosts/nixos/"
    click D "https://github.com/hugo-berendi/yomi/tree/main/home/"
    click E "https://github.com/hugo-berendi/yomi/tree/main/modules/"
    click F "https://github.com/hugo-berendi/yomi/tree/main/overlays/"
    click G "https://github.com/hugo-berendi/yomi/tree/main/pkgs/"
    click H "https://github.com/hugo-berendi/yomi/tree/main/devshells/"
    click J "https://github.com/hugo-berendi/yomi/tree/main/dns/"
    click K "https://github.com/hugo-berendi/yomi/tree/main/scripts/"

    %% Styles
    classDef flake fill:#f9c74f,stroke:#333,stroke-width:2px;
    classDef shared fill:#90be6d,stroke:#333,stroke-width:2px;
    classDef system fill:#43aa8b,stroke:#333,stroke-width:2px;
    classDef user fill:#f8961e,stroke:#333,stroke-width:2px;
    classDef modules fill:#277da1,stroke:#333,stroke-width:2px;
    classDef tools fill:#f94144,stroke:#333,stroke-width:2px;
```
