# ublue-os/bazzite architecture

> Architecture diagram of the GitHub repository ublue-os/bazzite, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ublue-os/bazzite
- Repository: https://github.com/ublue-os/bazzite

## Overview

##### Main Components

a. Core System Layer:
- Base Fedora Atomic OS (Kinoite/Silverblue)
- RPM-OSTree System Management
- SELinux Security Framework
- Custom Bazzite Kernel (based on kernel-fsync)

b. Desktop Environment Layer:
- KDE Plasma/GNOME variants
- Custom themes (Vapor/VGUI2)
- Server (X11/Wayland)

c. Gaming Layer:
- Steam Integration
- Gamescope Session
- Gaming-specific services
- Performance optimizations (LAVD/BORE CPU Schedulers)

d. Hardware Support Layer:
- Device-specific drivers
- Firmware management
- Power management
- Fan control

e. Container/Virtualization Layer:
- Distrobox integration
- Waydroid for Android apps
- Optional virtualization support

##### Relationship Flows

- Package management flow (rpm-ostree → system)
- Gaming session initialization (login → gamescope → Steam)
- Hardware management (kernel → device drivers → hardware)
- Update system flow (image updates → atomic deployment)

##### Specific Implementation Details

Create distinct sections for:
a. System Configuration:
- Custom package repositories
- System services
- Boot configuration

b. User Interface:
- Desktop environments
- Theme management
- Session handling

c. Gaming Features:
- Steam integration
- Performance optimizations
- Controller support

d. Storage Management:
- BTRFS support
- Automatic deduplication
- SD card handling

##### Additional Elements

- Update management system
- Security framework
- Hardware-specific optimizations
- External service integrations

##### The security model

- Component types
- Version indicators
- Configuration paths

This will create a comprehensive visualization that accurately represents Bazzite's sophisticated architecture while remaining clear and understandable.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Core["Core System Layer"]
        FedoraAtomic["Fedora Atomic OS"]
        RPMOSTree["RPM-OSTree System"]:::rpmostree
        SELinux["SELinux Security"]
        BazziteKernel["Custom Bazzite Kernel"]
    end

    subgraph Desktop["Desktop Environment Layer"]
        KDE["KDE Plasma"]:::kde
        GNOME["GNOME"]:::gnome
        Themes["Custom Themes"]:::themes
        DisplayServer["Display Server<br/>(X11/Wayland)"]
    end

    subgraph Gaming["Gaming Layer"]
        Steam["Steam Integration"]:::steam
        Gamescope["Gamescope Session"]:::gamescope
        GamingServices["Gaming Services"]
        PerfOpt["Performance Optimizations"]
    end

    subgraph Hardware["Hardware Support Layer"]
        Drivers["Device Drivers"]
        Firmware["Firmware Management"]:::firmware
        Power["Power Management"]:::power
        Fan["Fan Control"]:::fan
    end

    subgraph Container["Container/Virtualization Layer"]
        Distrobox["Distrobox"]
        Waydroid["Waydroid"]:::waydroid
        VirtSupport["Virtualization Support"]
    end

    subgraph Config["System Configuration"]
        Services["System Services"]:::services
        Boot["Boot Configuration"]:::boot
        HWSetup["Hardware Setup"]:::hwsetup
    end

    subgraph Audio["Audio/Display Components"]
        PipeWire["PipeWire"]:::pipewire
        Mesa["Mesa Graphics"]:::mesa
        Bluetooth["Bluetooth"]:::bluetooth
    end

    subgraph Nvidia["NVIDIA Components"]
        NvidiaConfig["NVIDIA Configuration"]:::nvidia
        NvidiaScripts["NVIDIA Scripts"]:::nvidiascripts
    end

    %% Relationships
    FedoraAtomic --> RPMOSTree
    RPMOSTree --> BazziteKernel
    BazziteKernel --> Drivers
    
    KDE & GNOME --> DisplayServer
    DisplayServer --> Gamescope
    Gamescope --> Steam
    
    BazziteKernel --> Hardware
    Hardware --> Fan
    Hardware --> Power
    Hardware --> Firmware
    
    DisplayServer --> PipeWire
    DisplayServer --> Mesa
    
    Services --> HWSetup
    Boot --> BazziteKernel

    %% Styling
    classDef default fill:#f9f9f9,stroke:#333,stroke-width:1px
    classDef core fill:#b3e0ff,stroke:#333
    classDef gaming fill:#98fb98,stroke:#333
    classDef hardware fill:#ffa07a,stroke:#333
    classDef container fill:#dda0dd,stroke:#333
    classDef security fill:#ff6b6b,stroke:#333

    %% Click events
    click RPMOSTree "https://github.com/ublue-os/bazzite/blob/main/spec_files/rpm-ostree/rpm-ostree.spec"
    click KDE "https://github.com/ublue-os/bazzite/tree/main/system_files/deck/kinoite/"
    click GNOME "https://github.com/ublue-os/bazzite/tree/main/system_files/deck/silverblue/"
    click Themes "https://github.com/ublue-os/bazzite/tree/main/spec_files/steamdeck-kde-presets/"
    click Gamescope "https://github.com/ublue-os/bazzite/blob/main/spec_files/gamescope/gamescope.spec"
    click Steam "https://github.com/ublue-os/bazzite/blob/main/spec_files/steam_notif_daemon/steam_notif_daemon.spec"
    click Fan "https://github.com/ublue-os/bazzite/blob/main/spec_files/jupiter-fan-control/jupiter-fan-control.spec"
    click Power "https://github.com/ublue-os/bazzite/blob/main/spec_files/powerbuttond/powerbuttond.spec"
    click Firmware "https://github.com/ublue-os/bazzite/tree/main/system_files/deck/shared/usr/lib/firmware/"
    click Waydroid "https://github.com/ublue-os/bazzite/blob/main/spec_files/waydroid/waydroid.spec"
    click PipeWire "https://github.com/ublue-os/bazzite/blob/main/spec_files/pipewire/pipewire.spec"
    click Mesa "https://github.com/ublue-os/bazzite/blob/main/spec_files/mesa/mesa.spec"
    click Bluetooth "https://github.com/ublue-os/bazzite/blob/main/spec_files/bluez/bluez.spec"
    click Services "https://github.com/ublue-os/bazzite/tree/main/system_files/deck/shared/usr/lib/systemd/system/"
    click HWSetup "https://github.com/ublue-os/bazzite/blob/main/system_files/desktop/shared/usr/lib/systemd/system/bazzite-hardware-setup.service"
    click Boot "https://github.com/ublue-os/bazzite/tree/main/system_files/deck/shared/etc/default/"
    click NvidiaConfig "https://github.com/ublue-os/bazzite/tree/main/system_files/nvidia/"
    click NvidiaScripts "https://github.com/ublue-os/bazzite/blob/main/system_files/nvidia/shared/usr/share/ublue-os/just/95-bazzite-nvidia.jus"
```
