# ublue-os/hwe architecture

> Architecture diagram of the GitHub repository ublue-os/hwe, 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/ublue-os/hwe
- Repository: https://github.com/ublue-os/hwe

## Overview

a. Build Pipeline (Top section)
- GitHub Actions Workflows
- Container Build Process
- Release Management

b. Installation Flow (Middle section)
- Image Selection
- Hardware Detection
- Driver Installation

##### Important Relationships

- Build System → Image Generation
- Hardware Detection → Configuration Application
- Package Management → System Integration
- System Services → Hardware Support

##### Special Features

- Version control for different Fedora releases (40/41)
- Driver fallback mechanisms
- Configuration inheritance paths
- System file overlay structure

##### System integration points

- Version indicators
- Configuration flow markers

This will help other engineers understand how the system handles hardware support across different devices and driver versions while maintaining stability and reliability.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Define styles
    classDef base fill:#3498db,stroke:#2980b9,color:white
    classDef asus fill:#2ecc71,stroke:#27ae60,color:white
    classDef surface fill:#9b59b6,stroke:#8e44ad,color:white
    classDef nvidia fill:#e67e22,stroke:#d35400,color:white
    classDef shared fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef build fill:#34495e,stroke:#2c3e50,color:white

    %% Base Layer
    Base[Fedora Base Image]:::base

    %% Build Pipeline
    subgraph BuildSystem["Build and Release Pipeline"]
        GH["GitHub Actions"]
        CB["Container Build"]
        RM["Release Management"]
    end
    click GH "https://github.com/ublue-os/hwe/tree/main//.github/workflows/"
    click CB "https://github.com/ublue-os/hwe/tree/main//Containerfile"

    %% Hardware Support Modules
    subgraph HWSupport["Hardware Support Modules"]
        ASUS{{ASUS Support}}
        Surface{{Surface Support}}
        NVIDIA{{NVIDIA Support}}
    end

    %% ASUS Configuration
    subgraph ASUSConfig["ASUS Configuration"]
        AP["Package Config"]
        AWP["WirePlumber Audio"]
        ASC["System Config"]
    end
    click AP "https://github.com/ublue-os/hwe/blob/main//asus/packages.json"
    click AWP "https://github.com/ublue-os/hwe/blob/main//asus/system_files/shared/usr/share/wireplumber/main.lua.d/50-alsa-config.lua"

    %% Surface Configuration
    subgraph SurfaceConfig["Surface Configuration"]
        SP["Package Config"]
        SHS["Hardware Setup"]
        SMC["Module Config"]
        SDC["DConf Settings"]
        SSS["Systemd Services"]
    end
    click SP "https://github.com/ublue-os/hwe/blob/main//surface/packages.json"
    click SHS "https://github.com/ublue-os/hwe/tree/main//surface/system_files/shared/usr/bin/surface-hardware-setup"
    click SMC "https://github.com/ublue-os/hwe/blob/main//surface/system_files/shared/usr/etc/modules-load.d/ublue-surface.conf"
    click SDC "https://github.com/ublue-os/hwe/tree/main//surface/system_files/silverblue/usr/etc/dconf/db/local.d/01-ublue-surface"
    click SSS "https://github.com/ublue-os/hwe/blob/main//surface/system_files/shared/usr/lib/systemd/system/surface-hardware-setup.service"

    %% NVIDIA Configuration
    subgraph NVIDIAConfig["NVIDIA Configuration"]
        NI["Installation Script"]
        NDM["Driver Management"]
        NRB["Rollback System"]
    end
    click NI "https://github.com/ublue-os/hwe/blob/main//nvidia-install.sh"

    %% System Management
    subgraph SystemMgmt["System Management"]
        IS["Installation Script"]
        PM["Package Management"]
        IB["Initramfs Build"]
        CS["Cleanup Script"]
        II["Image Info"]
    end
    click IS "https://github.com/ublue-os/hwe/blob/main//install.sh"
    click PM "https://github.com/ublue-os/hwe/blob/main//packages.sh"
    click IB "https://github.com/ublue-os/hwe/blob/main//build-initramfs.sh"
    click CS "https://github.com/ublue-os/hwe/blob/main//cleanup.sh"
    click II "https://github.com/ublue-os/hwe/blob/main//image-info.sh"

    %% Version Control
    subgraph Versions["Version Control"]
        V40["Fedora 40"]
        V41["Fedora 41"]
    end
    click V40 "https://github.com/ublue-os/hwe/blob/main//.github/workflows/build-40.yml"
    click V41 "https://github.com/ublue-os/hwe/blob/main//.github/workflows/build-41.yml"

    %% Relationships
    Base --> BuildSystem
    BuildSystem --> HWSupport
    ASUS --> ASUSConfig
    Surface --> SurfaceConfig
    NVIDIA --> NVIDIAConfig
    HWSupport --> SystemMgmt
    BuildSystem --> Versions

    %% Legend
    subgraph Legend
        L1[Base Components]:::base
        L2[ASUS Components]:::asus
        L3[Surface Components]:::surface
        L4[NVIDIA Components]:::nvidia
        L5[Shared Components]:::shared
        L6[Build Components]:::build
    end
```
