# b-ran/dots architecture

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

- Interactive diagram: https://gitdiagram.com/b-ran/dots
- Repository: https://github.com/b-ran/dots

## Overview

##### Main System Components

a) Core System Layer
- NixOS as the foundation layer
- Hardware configuration components
- Boot configuration (UEFI/GPT setup)

b) System Management Layer
- Flake-based configuration management
- Home-Manager integration
- Stylix theme management
- Host-specific configurations (desktop and work)

c) Desktop Environment Layer
- Hyprland (Window Manager)
- SDDM (Display Manager)
- Waybar (Status Bar)
- Desktop services (dunst, udiskie)

##### Component Relationships

**[System Foundation]**

- [Flake Configuration]
- [Host Configurations]
- Desktop
- Work

- [Home-Manager]
- Programs
- CLI Tools
- Desktop Apps
- System Services

- XDG Configuration

- [Darwin Configuration]

- [Desktop Environment]
- Hyprland
- Waybar
- Rofi
- System Services

- [Theme Management]
- Stylix

##### Specific Implementation Details

a) Configuration Flow:
- How the flake.nix serves as the entry point
- How different modules are composed
- Demonstrate the relationship between hosts and shared configurations

b) Program Management:
- Programs by type (CLI, Desktop, Services)
- How Home-Manager manages user programs
- System-wide vs user-specific configurations

c) Theme System:
- How Stylix integrates with various components
- Wallpaper and theme management flow

##### Technical Details to Highlight

- NixOS module system
- Home-Manager integration
- Wayland-based desktop setup
- System service management
- Theme propagation through Stylix

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Core
        NixOS[NixOS Base System]
        Boot[Boot Configuration]
        HWConfig[Hardware Configuration]
        NixOS --> Boot
        NixOS --> HWConfig
    end

    subgraph ConfigManagement
        Flake[Flake Configuration]
        SysModules[System Modules]
        HomeManager[Home Manager]
        Darwin[Darwin/MacOS Config]
        
        Flake --> SysModules
        Flake --> HomeManager
        Flake --> Darwin
    end

    subgraph HostConfigs
        Desktop[Desktop Host]
        Work[Work Host]
        
        SysModules --> Desktop
        SysModules --> Work
    end

    subgraph ThemeManagement
        Stylix[Stylix Theme System]
        Wallpaper[Wallpaper Management]
        
        Stylix --> Wallpaper
    end

    subgraph DesktopEnvironment
        Hyprland[Hyprland WM]
        SDDM[SDDM Display Manager]
        Waybar[Waybar Status Bar]
        
        Hyprland --> Waybar
        SDDM --> Hyprland
    end

    subgraph UserPrograms
        DesktopApps[Desktop Applications]
        CLITools[CLI Tools]
        Rofi[Rofi Launcher]
        
        HomeManager --> DesktopApps
        HomeManager --> CLITools
        HomeManager --> Rofi
    end

    subgraph Services
        Dunst[Dunst Notifications]
        Udiskie[Udiskie Mount Tool]
        
        HomeManager --> Dunst
        HomeManager --> Udiskie
    end

    %% Core System Connections
    Core --> ConfigManagement
    ConfigManagement --> DesktopEnvironment
    ConfigManagement --> ThemeManagement

    %% Theme Application
    Stylix --> DesktopEnvironment
    Stylix --> UserPrograms
    
    %% Component Mappings
    click Boot "https://github.com/b-ran/dots/blob/main/modules/boot.nix"
    click HWConfig "https://github.com/b-ran/dots/blob/main/hosts/desktop/hardware-configuration.nix"
    click Flake "https://github.com/b-ran/dots/blob/main/flake.nix"
    click HomeManager "https://github.com/b-ran/dots/blob/main/home/default.nix"
    click Stylix "https://github.com/b-ran/dots/blob/main/modules/stylix/default.nix"
    click Desktop "https://github.com/b-ran/dots/blob/main/hosts/desktop/default.nix"
    click Work "https://github.com/b-ran/dots/blob/main/hosts/work/default.nix"
    click Hyprland "https://github.com/b-ran/dots/blob/main/modules/hyprland.nix"
    click SDDM "https://github.com/b-ran/dots/blob/main/modules/sddm.nix"
    click Waybar "https://github.com/b-ran/dots/blob/main/home/programs/desktop/waybar/default.nix"
    click Dunst "https://github.com/b-ran/dots/blob/main/home/services/dunst.nix"
    click Udiskie "https://github.com/b-ran/dots/blob/main/home/services/udiskie.nix"
    click DesktopApps "https://github.com/b-ran/dots/blob/main/home/programs/desktop/default.nix"
    click CLITools "https://github.com/b-ran/dots/tree/main/home/programs/cli/"
    click SysModules "https://github.com/b-ran/dots/blob/main/modules/default.nix"
    click Wallpaper "https://github.com/b-ran/dots/blob/main/modules/wallpaper.nix"
    click Darwin "https://github.com/b-ran/dots/blob/main/darwin/default.nix"

    classDef core fill:#2b6cb0,stroke:#1a4971,color:white
    classDef config fill:#38a169,stroke:#2f855a,color:white
    classDef desktop fill:#dd6b20,stroke:#c05621,color:white
    classDef service fill:#805ad5,stroke:#6b46c1,color:white
    classDef theme fill:#d53f8c,stroke:#b83280,color:white

    class NixOS,Boot,HWConfig core
    class Flake,SysModules,HomeManager,Darwin config
    class Hyprland,SDDM,Waybar,DesktopApps,Rofi desktop
    class Dunst,Udiskie service
    class Stylix,Wallpaper theme
```
