# theobori/nixos-configuration architecture

> Architecture diagram of the GitHub repository theobori/nixos-configuration, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/theobori/nixos-configuration
- Repository: https://github.com/theobori/nixos-configuration

## Overview

##### Project Type and Purpose
This is a NixOS system configuration project that uses the Snowfall library structure to manage system configurations, home environments, and various modules in a declarative way.

##### Main Components

A. Core Configuration Layer:
- System Configurations (systems/)
- Home Configurations (homes/)
- Modules (modules/)
- Packages (packages/)
- Overlays (overlays/)

B. Module Categories:
- NixOS Modules
- Home Manager Modules
- System Services
- User Services

C. Integration Components:
- Secret Management (sops-nix)
- Theme Management (stylix)
- Package Management (Nix, Flatpak)
- Development Environment (devShell)

##### Use a Multi-Layer Architecture

**┌─────────────────────────────────────────────────────┐**
- Configuration Layer                 │
- ┬─────────────┬────────────┬───────────┤
- Systems    │    Homes    │  Modules   │ Packages  │
- ┴─────────────┴────────────┴───────────┘
- ↓             ↓            ↓           ↓
**┌─────────────────────────────────────────────────────┐**
- Integration Layer                   │
- ┬─────────────┬────────────┬───────────┤
- sops-nix   │   stylix    │  Flatpak   │  Cachix   │
- ┴─────────────┴────────────┴───────────┘
- ↓             ↓            ↓           ↓
**┌─────────────────────────────────────────────────────┐**
- Service Layer                      │
- ┬─────────────┬────────────┬───────────┤
- NixOS    │Home Manager │  Desktop   │  System   │
- ┴─────────────┴────────────┴───────────┘

##### Detailed Elements
- Package management flows
- CI/CD pipeline with GitHub Actions
- Development shell environment

**┌─────────────────────────────┐**
- ┤
- → Direct Dependency         │
- ⇢ Optional Dependency       │
- ↔ Interactive Relationship  │
- □ Core Component           │
- ○ Service                  │
- ◇ Integration Point        │
- ┘

##### The secret management and theming systems

Remember to include notes about:
- The Snowfall library structure
- The flake-based configuration
- The development shell capabilities
- The CI/CD integration with Cachix

This will provide a comprehensive view of the system while keeping it understandable for other developers.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef integration fill:#2ecc71,stroke:#27ae60,color:white
    classDef service fill:#e67e22,stroke:#d35400,color:white
    classDef user fill:#9b59b6,stroke:#8e44ad,color:white
    
    %% Configuration Layer
    subgraph ConfigLayer["Configuration Layer"]
        Systems["System Configurations"]
        Homes["Home Configurations"]
        Modules["Modules"]
        Packages["Packages"]
        Overlays["Overlays"]
    end

    %% Module Categories
    subgraph ModuleLayer["Module Categories"]
        NixOSMods["NixOS Modules"]
        HomeMods["Home Manager Modules"]
        SysServices["System Services"]
        UserServices["User Services"]
    end

    %% Integration Layer
    subgraph IntegrationLayer["Integration Layer"]
        Secrets["Secret Management"]
        Themes["Theme Management"]
        PackageMan["Package Management"]
        DevEnv["Development Environment"]
    end

    %% Service Layer
    subgraph ServiceLayer["Service Layer"]
        NixOS["NixOS"]
        HomeManager["Home Manager"]
        Desktop["Desktop Environments"]
        SystemServ["System Services"]
    end

    %% Desktop Environments
    subgraph DesktopEnvs["Desktop Environments"]
        GNOME["GNOME"]
        Plasma["KDE Plasma"]
    end

    %% Roles
    subgraph Roles["Role-based Configurations"]
        HomeRoles["Home Roles"]
        NixOSRoles["NixOS Roles"]
    end

    %% Relationships
    Systems --> NixOS
    Homes --> HomeManager
    Modules --> NixOSMods & HomeMods
    Packages --> PackageMan
    Overlays --> PackageMan

    NixOSMods --> NixOS
    HomeMods --> HomeManager
    SysServices --> SystemServ
    UserServices --> HomeManager

    Desktop --> GNOME & Plasma
    
    HomeRoles --> HomeManager
    NixOSRoles --> NixOS

    %% Click Events
    click Systems "https://github.com/theobori/nixos-configuration/tree/main/systems/"
    click Homes "https://github.com/theobori/nixos-configuration/tree/main/homes/"
    click NixOSMods "https://github.com/theobori/nixos-configuration/tree/main/modules/nixos/"
    click HomeMods "https://github.com/theobori/nixos-configuration/tree/main/modules/home/"
    click Packages "https://github.com/theobori/nixos-configuration/tree/main/packages/"
    click Overlays "https://github.com/theobori/nixos-configuration/tree/main/overlays/"
    click Secrets "https://github.com/theobori/nixos-configuration/tree/main/modules/home/services/sops/"
    click Themes "https://github.com/theobori/nixos-configuration/tree/main/modules/home/styles/stylix/"
    click DevEnv "https://github.com/theobori/nixos-configuration/tree/main/shells/default/"
    click PackageMan "https://github.com/theobori/nixos-configuration/tree/main/modules/home/services/flatpak/"
    click HomeRoles "https://github.com/theobori/nixos-configuration/tree/main/modules/home/roles/"
    click NixOSRoles "https://github.com/theobori/nixos-configuration/tree/main/modules/nixos/roles/"
    click SysServices "https://github.com/theobori/nixos-configuration/tree/main/modules/nixos/services/"
    click UserServices "https://github.com/theobori/nixos-configuration/tree/main/modules/home/services/"
    click GNOME "https://github.com/theobori/nixos-configuration/tree/main/modules/nixos/desktops/gnome/"
    click Plasma "https://github.com/theobori/nixos-configuration/tree/main/modules/nixos/desktops/plasma6/"

    %% Style Applications
    class Systems,Homes,Modules,Packages,Overlays core
    class Secrets,Themes,PackageMan,DevEnv integration
    class NixOS,HomeManager,Desktop,SystemServ service
    class HomeRoles,NixOSRoles,HomeMods,NixOSMods user

    %% Legend
    subgraph Legend["Legend"]
        L1["Core Component"]:::core
        L2["Integration Component"]:::integration
        L3["Service Component"]:::service
        L4["User Component"]:::user
    end
```
