# ludovicopiero/dotfiles architecture

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

- Interactive diagram: https://gitdiagram.com/ludovicopiero/dotfiles
- Repository: https://github.com/ludovicopiero/dotfiles

## Overview

##### Main Components Structure

a) Configuration Layer (Top Level)
- "flake.nix" at the top as the entry point
- To hosts/ and modules/ directories

b) Host Configuration Layer
- "hosts/sforza" as the main system configuration
- Link to hardware-configuration.nix and configuration.nix

c) Modules Layer (Group by functionality)
- System Modules:
- Desktop Environment (Hyprland, Waybar, Mako)
- Security (GPG, Secrets)
- Network (DNSCrypt2, TeaVPN2)
- User Applications:
- Shell Environment (Fish)
- Browsers (Firefox, Floorp)
- Development Tools (Neovim)
- Input Methods (Fcitx5)

##### Component Relationships

Key relationships:
- Flake.nix → Host Configuration
- Host Configuration → Module Groups
- Module Dependencies (e.g., XDG-Portal → Hyprland)
- Secrets Management Flow

##### Specific Implementation Details

Crucial elements:
- Home-Manager integration (modules/shared/home-manager.nix)
- Theme system (modules/theme)
- Security layer (modules/shared/security.nix)
- User management (modules/shared/users.nix)

**┌─ Flake.nix ─────────────────────┐**

- ┌─ Hosts ─┐    ┌─ Modules ─┐  │
- Sforza  │    │ Desktop   │  │
- ↔  │ Security  │  │
- ┘    │ Network   │  │
- Apps      │  │
- ┘  │
- ┘

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Main Entry Point
    Flake[("flake.nix")]:::entry
    click Flake "https://github.com/LudovicoPiero/dotfiles/blob/main/flake.nix"

    %% Host Configuration
    subgraph Host["Host Configuration"]
        HostConfig["configuration.nix"]:::host
        HardwareConfig["hardware-configuration.nix"]:::host
        click HostConfig "https://github.com/LudovicoPiero/dotfiles/blob/main/hosts/sforza/configuration.nix"
        click HardwareConfig "https://github.com/LudovicoPiero/dotfiles/blob/main/hosts/sforza/hardware-configuration.nix"
    end

    %% Desktop Environment
    subgraph Desktop["Desktop Environment"]
        Hyprland["Hyprland"]:::desktop
        Waybar["Waybar"]:::desktop
        Mako["Mako"]:::desktop
        XDGPortal["XDG Portal"]:::desktop
        click Hyprland "https://github.com/LudovicoPiero/dotfiles/tree/main/modules/hyprland/"
        click Waybar "https://github.com/LudovicoPiero/dotfiles/tree/main/modules/waybar/"
        click Mako "https://github.com/LudovicoPiero/dotfiles/tree/main/modules/mako/"
        click XDGPortal "https://github.com/LudovicoPiero/dotfiles/tree/main/modules/xdg-portal/"
    end

    %% Session Management
    subgraph Session["Session Management"]
        Greetd["Greetd"]:::session
        Hypridle["Hypridle"]:::session
        Hyprlock["Hyprlock"]:::session
        click Greetd "https://github.com/LudovicoPiero/dotfiles/tree/main/modules/greetd/"
        click Hypridle "https://github.com/LudovicoPiero/dotfiles/tree/main/modules/hypridle/"
        click Hyprlock "https://github.com/LudovicoPiero/dotfiles/tree/main/modules/hyprlock/"
    end

    %% Security Components
    subgraph Security["Security Layer"]
        GPG["GPG"]:::security
        Secrets["Secrets"]:::security
        SecurityLayer["Security Core"]:::security
        click GPG "https://github.com/LudovicoPiero/dotfiles/tree/main/modules/gpg/"
        click Secrets "https://github.com/LudovicoPiero/dotfiles/tree/main/modules/secrets/"
        click SecurityLayer "https://github.com/LudovicoPiero/dotfiles/blob/main/modules/shared/security.nix"
    end

    %% Network Services
    subgraph Network["Network Services"]
        DNSCrypt["DNSCrypt2"]:::network
        TeaVPN["TeaVPN2"]:::network
        click DNSCrypt "https://github.com/LudovicoPiero/dotfiles/tree/main/modules/dnscrypt2/"
        click TeaVPN "https://github.com/LudovicoPiero/dotfiles/tree/main/modules/teavpn2/"
    end

    %% User Applications
    subgraph Apps["User Applications"]
        Fish["Fish Shell"]:::app
        Firefox["Firefox"]:::app
        Floorp["Floorp"]:::app
        Neovim["Neovim"]:::app
        Fcitx5["Fcitx5"]:::app
        click Fish "https://github.com/LudovicoPiero/dotfiles/tree/main/modules/fish/"
        click Firefox "https://github.com/LudovicoPiero/dotfiles/tree/main/modules/firefox/"
        click Floorp "https://github.com/LudovicoPiero/dotfiles/tree/main/modules/floorp/"
        click Neovim "https://github.com/LudovicoPiero/dotfiles/tree/main/modules/nvim/"
        click Fcitx5 "https://github.com/LudovicoPiero/dotfiles/tree/main/modules/fcitx5/"
    end

    %% Core System Components
    subgraph Core["Core System"]
        HomeManager["Home Manager"]:::core
        ThemeSystem["Theme System"]:::core
        UserManagement["User Management"]:::core
        Variables["System Variables"]:::core
        click HomeManager "https://github.com/LudovicoPiero/dotfiles/blob/main/modules/shared/home-manager.nix"
        click ThemeSystem "https://github.com/LudovicoPiero/dotfiles/tree/main/modules/theme/"
        click UserManagement "https://github.com/LudovicoPiero/dotfiles/blob/main/modules/shared/users.nix"
        click Variables "https://github.com/LudovicoPiero/dotfiles/tree/main/modules/vars/"
    end

    %% Relationships
    Flake --> Host
    Host --> Desktop
    Host --> Security
    Host --> Network
    Host --> Apps
    Host --> Core
    Host --> Session
    
    Desktop --> XDGPortal
    Security --> SecurityLayer
    Core --> HomeManager

    %% Styles
    classDef entry fill:#f9f,stroke:#333,stroke-width:4px
    classDef host fill:#ffd700,stroke:#333
    classDef desktop fill:#90EE90,stroke:#333
    classDef session fill:#98FB98,stroke:#333
    classDef security fill:#ff6b6b,stroke:#333
    classDef network fill:#87CEEB,stroke:#333
    classDef app fill:#DDA0DD,stroke:#333
    classDef core fill:#FFB6C1,stroke:#333

    %% Legend
    subgraph Legend
        L1[("Entry Point")]:::entry
        L2["Host Config"]:::host
        L3["Desktop"]:::desktop
        L4["Session"]:::session
        L5["Security"]:::security
        L6["Network"]:::network
        L7["Applications"]:::app
        L8["Core System"]:::core
    end
```
