# ublue-os/bluefin architecture

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

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

## Overview

1. Bluefin is an immutable Fedora-based desktop OS image repository, not an application codebase. Its main product is a bootable system image, with two clear flavors: a shared desktop base and a developer-focused “dx” variant.

2. The architecture is split into build-time assembly and runtime customization. Build-time logic lives under `build_files/`, while filesystem overlays and first-boot hooks live under `system_files/`. The repo’s `Containerfile` and GitHub Actions workflows turn these inputs into distributable images.

3. `build_files/base/` defines the core OS composition: image metadata, kernel/akmods handling, package installation, initramfs generation, cleanup, and testing. This is the lowest layer of the stack and is responsible for making the image bootable and update-safe.

4. `build_files/dx/` adds the developer-oriented layer. It extends the base with extra build steps and tests for tools and kernel/virtualization support that matter for developer workflows, especially Docker/VM/container usage.

5. `build_files/shared/` holds common orchestration and utility scripts used by both image variants. This is the build boundary where reusable logic sits, including repo validation, stage cleanup, container/image build helpers, and GNOME extension build support.

6. `system_files/shared/` is the runtime overlay applied to all images. It includes GNOME Shell extensions, a shell prompt profile, an `rpm-ostreed` config, and a small system service to remove Fedora flatpak remotes. This layer shapes the default desktop experience after boot.

7. `system_files/shared/usr/share/ublue-os/*hooks.d` defines the first-boot lifecycle. There are distinct hook phases for system setup, privileged setup, and user setup, which lets Bluefin separate root-only changes, machine-wide configuration, and per-user defaults.

8. The shared hooks show the main functional integrations: theming, Tailscale setup, Flatpak provisioning, and Framework hardware support. This indicates the image is designed to configure itself on first boot rather than relying on manual post-install steps.

9. `system_files/dx/` adds developer-specific runtime behavior. It preconfigures VS Code user settings, enables Docker-related sysctl tweaks, installs dracut VFIO configuration, and ships systemd/tmpfiles units for Incus, libvirt, and swtpm workarounds. These pieces support local containers, VMs, and device passthrough workflows.

10. The DX flavor also includes a small group-management helper and a VS Code user-setup hook. That suggests a user-facing developer environment that is partially provisioned at image build time and partially completed on first login.

11. The systemd units and dracut config are important architectural boundaries. They show that Bluefin is not just layering packages; it is modifying boot-time behavior, kernel initramfs content, and service startup to make virtualization and hardware integration reliable.

12. The release/distribution pipeline is GitHub Actions–driven. Workflows build stable, latest-main, and beta images, generate releases, validate Renovate, and perform cleanup, while `cosign.pub` and version files indicate signed and version-pinned image delivery.

13. In diagram terms, the core flow is: source overlays and scripts → containerized build pipeline → image variants → first-boot hooks/system services → user desktop and dev environment. The main architectural boundaries are base vs dx, build-time vs first-boot/runtime, and shared vs variant-specific customizations.

Main entry points: [`build_files/base`](https://github.com/ublue-os/bluefin/tree/main/build_files/base) (Base build), [`.github/workflows`](https://github.com/ublue-os/bluefin/blob/main/.github/workflows) (Release pipeline), [`build_files/shared`](https://github.com/ublue-os/bluefin/tree/main/build_files/shared) (Shared build), [`system_files/dx`](https://github.com/ublue-os/bluefin/tree/main/system_files/dx) (DX runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_build["Build-time"]
  node_containerfile["Containerfile<br/>build image"]
  node_build_shared["Shared build<br/>orchestration"]
  node_build_base["Base build<br/>os composition"]
  node_build_dx["DX build<br/>variant assembly"]
  node_base_image_info["Image info<br/>metadata<br/>[00-image-info.sh]"]
  node_base_kernel["Kernel/akmods<br/>boot kernel"]
  node_base_packages["Packages<br/>package set<br/>[04-packages.sh]"]
  node_base_initramfs["Initramfs<br/>boot image<br/>[19-initramfs.sh]"]
  node_base_cleanup["Cleanup<br/>image hygiene<br/>[17-cleanup.sh]"]
  node_base_tests["Base tests<br/>validation<br/>[20-tests.sh]"]
  node_dx_build["DX setup<br/>developer layer<br/>[00-dx.sh]"]
  node_dx_tests["DX tests<br/>validation<br/>[01-tests-dx.sh]"]
  node_build_script["Build script<br/>pipeline runner<br/>[build.sh]"]
  node_build_dx_script["DX builder<br/>pipeline runner<br/>[build-dx.sh]"]
  node_validate_repos["Repo check<br/>validation<br/>[validate-repos.sh]"]
end

subgraph group_runtime["Runtime"]
  node_system_shared["Shared runtime<br/>desktop overlay"]
  node_hooks_shared["Shared hooks<br/>first-boot lifecycle"]
  node_theming_hook["Theming<br/>user setup<br/>[10-theming.sh]"]
  node_tailscale_hook["Tailscale<br/>privileged setup<br/>[10-tailscale.sh]"]
  node_flatpaks_hook["Flatpaks<br/>privileged setup<br/>[99-flatpaks.sh]"]
  node_framework_hook["Framework<br/>system setup<br/>[10-framework.sh]"]
  node_runtime_services["Runtime services<br/>desktop defaults"]
  node_dx_runtime["DX runtime<br/>developer overlay"]
  node_dx_vscode["VS Code<br/>user config<br/>[settings.json]"]
  node_dx_hooks["DX hooks<br/>user setup<br/>[10-vscode.sh]"]
  node_dx_vfio["VFIO<br/>dracut config<br/>[80-vfio.conf]"]
  node_dx_services["VM services<br/>service layer"]
  node_dx_sysctl["Docker sysctl<br/>kernel tuning<br/>[docker-ce.conf]"]
end

subgraph group_release["Release"]
  node_release_pipeline["Release pipeline<br/>github actions<br/>[workflows]"]
  node_workflow_builds["Image builds<br/>workflow set<br/>[build-images.yml]"]
  node_workflow_release["Release flow<br/>workflow"]
  node_workflow_validate["Validation<br/>workflow"]
  node_cosign_pub["Cosign key<br/>signature trust<br/>[cosign.pub]"]
  node_versions["Versions<br/>release pins<br/>[image-versions.yml]"]
end

node_containerfile -->|"builds via"| node_build_script
node_build_script -->|"uses"| node_build_shared
node_build_shared -->|"orchestrates"| node_build_base
node_build_shared -->|"orchestrates"| node_build_dx
node_build_base -->|"includes"| node_base_image_info
node_build_base -->|"includes"| node_base_kernel
node_build_base -->|"includes"| node_base_packages
node_build_base -->|"includes"| node_base_initramfs
node_build_base -->|"includes"| node_base_cleanup
node_build_base -->|"validates"| node_base_tests
node_build_dx -->|"extends"| node_dx_build
node_build_dx -->|"validates"| node_dx_tests
node_build_dx -->|"orchestrates"| node_build_dx_script
node_build_shared -->|"checks"| node_validate_repos
node_system_shared -->|"contains"| node_hooks_shared
node_hooks_shared -->|"applies"| node_theming_hook
node_hooks_shared -->|"applies"| node_tailscale_hook
node_hooks_shared -->|"applies"| node_flatpaks_hook
node_hooks_shared -->|"applies"| node_framework_hook
node_system_shared -->|"contains"| node_runtime_services
node_dx_runtime -->|"contains"| node_dx_vscode
node_dx_runtime -->|"contains"| node_dx_hooks
node_dx_runtime -->|"contains"| node_dx_vfio
node_dx_runtime -->|"contains"| node_dx_services
node_dx_runtime -->|"contains"| node_dx_sysctl
node_release_pipeline -->|"drives"| node_workflow_builds
node_release_pipeline -->|"drives"| node_workflow_release
node_release_pipeline -->|"drives"| node_workflow_validate
node_release_pipeline -->|"uses"| node_cosign_pub
node_release_pipeline -->|"uses"| node_versions
node_build_shared -.->|"packages"| node_system_shared
node_build_shared -.->|"packages"| node_dx_runtime
node_release_pipeline -.->|"builds"| node_containerfile

click node_containerfile "https://github.com/ublue-os/bluefin/tree/main/Containerfile"
click node_build_shared "https://github.com/ublue-os/bluefin/tree/main/build_files/shared"
click node_build_base "https://github.com/ublue-os/bluefin/tree/main/build_files/base"
click node_build_dx "https://github.com/ublue-os/bluefin/tree/main/build_files/dx"
click node_base_image_info "https://github.com/ublue-os/bluefin/blob/main/build_files/base/00-image-info.sh"
click node_base_kernel "https://github.com/ublue-os/bluefin/blob/main/build_files/base/03-install-kernel-akmods.sh"
click node_base_packages "https://github.com/ublue-os/bluefin/blob/main/build_files/base/04-packages.sh"
click node_base_initramfs "https://github.com/ublue-os/bluefin/blob/main/build_files/base/19-initramfs.sh"
click node_base_cleanup "https://github.com/ublue-os/bluefin/blob/main/build_files/base/17-cleanup.sh"
click node_base_tests "https://github.com/ublue-os/bluefin/blob/main/build_files/base/20-tests.sh"
click node_dx_build "https://github.com/ublue-os/bluefin/blob/main/build_files/dx/00-dx.sh"
click node_dx_tests "https://github.com/ublue-os/bluefin/blob/main/build_files/dx/01-tests-dx.sh"
click node_build_script "https://github.com/ublue-os/bluefin/blob/main/build_files/shared/build.sh"
click node_build_dx_script "https://github.com/ublue-os/bluefin/blob/main/build_files/shared/build-dx.sh"
click node_validate_repos "https://github.com/ublue-os/bluefin/blob/main/build_files/shared/validate-repos.sh"
click node_system_shared "https://github.com/ublue-os/bluefin/tree/main/system_files/shared"
click node_hooks_shared "https://github.com/ublue-os/bluefin/tree/main/system_files/shared/usr/share/ublue-os"
click node_theming_hook "https://github.com/ublue-os/bluefin/blob/main/system_files/shared/usr/share/ublue-os/user-setup.hooks.d/10-theming.sh"
click node_tailscale_hook "https://github.com/ublue-os/bluefin/blob/main/system_files/shared/usr/share/ublue-os/privileged-setup.hooks.d/10-tailscale.sh"
click node_flatpaks_hook "https://github.com/ublue-os/bluefin/blob/main/system_files/shared/usr/share/ublue-os/privileged-setup.hooks.d/99-flatpaks.sh"
click node_framework_hook "https://github.com/ublue-os/bluefin/blob/main/system_files/shared/usr/share/ublue-os/system-setup.hooks.d/10-framework.sh"
click node_runtime_services "https://github.com/ublue-os/bluefin/tree/main/system_files/shared"
click node_dx_runtime "https://github.com/ublue-os/bluefin/tree/main/system_files/dx"
click node_dx_vscode "https://github.com/ublue-os/bluefin/blob/main/system_files/dx/etc/skel/.config/Code/User/settings.json"
click node_dx_hooks "https://github.com/ublue-os/bluefin/blob/main/system_files/dx/usr/share/ublue-os/user-setup.hooks.d/10-vscode.sh"
click node_dx_vfio "https://github.com/ublue-os/bluefin/blob/main/system_files/dx/usr/lib/dracut/dracut.conf.d/80-vfio.conf"
click node_dx_services "https://github.com/ublue-os/bluefin/tree/main/system_files/dx/usr/lib/systemd/system"
click node_dx_sysctl "https://github.com/ublue-os/bluefin/blob/main/system_files/dx/usr/lib/sysctl.d/docker-ce.conf"
click node_release_pipeline "https://github.com/ublue-os/bluefin/blob/main/.github/workflows"
click node_workflow_builds "https://github.com/ublue-os/bluefin/blob/main/.github/workflows/build-images.yml"
click node_workflow_release "https://github.com/ublue-os/bluefin/blob/main/.github/workflows/generate-release.yml"
click node_workflow_validate "https://github.com/ublue-os/bluefin/blob/main/.github/workflows/validate-renovate.yml"
click node_cosign_pub "https://github.com/ublue-os/bluefin/blob/main/cosign.pub"
click node_versions "https://github.com/ublue-os/bluefin/blob/main/image-versions.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_containerfile,node_build_shared,node_build_base,node_build_dx,node_base_image_info,node_base_kernel,node_base_packages,node_base_initramfs,node_base_cleanup,node_base_tests,node_dx_build,node_dx_tests,node_build_script,node_build_dx_script,node_validate_repos toneBlue
class node_system_shared,node_hooks_shared,node_theming_hook,node_tailscale_hook,node_flatpaks_hook,node_framework_hook,node_runtime_services,node_dx_runtime,node_dx_vscode,node_dx_hooks,node_dx_vfio,node_dx_services,node_dx_sysctl toneAmber
class node_release_pipeline,node_workflow_builds,node_workflow_release,node_workflow_validate,node_cosign_pub,node_versions toneMint
```

## Components

### Build-time

Containerized image assembly and reusable build scripts.

- [Containerfile](https://github.com/ublue-os/bluefin/tree/main/Containerfile): build image · Defines the containerized image build entrypoint. · `Containerfile`
- [Shared build](https://github.com/ublue-os/bluefin/tree/main/build_files/shared): orchestration · Common build helpers and reusable scripts for both variants. · `build_files/shared`
- [Base build](https://github.com/ublue-os/bluefin/tree/main/build_files/base): os composition · Core Fedora-based image assembly for the shared desktop base. · `build_files/base`
- [DX build](https://github.com/ublue-os/bluefin/tree/main/build_files/dx): variant assembly · Developer-focused build layer extending the base image. · `build_files/dx`
- [Image info](https://github.com/ublue-os/bluefin/blob/main/build_files/base/00-image-info.sh): metadata · Image identity and release metadata. · `build_files/base/00-image-info.sh`
- [Kernel/akmods](https://github.com/ublue-os/bluefin/blob/main/build_files/base/03-install-kernel-akmods.sh): boot kernel · Kernel and akmods handling for the bootable image. · `build_files/base/03-install-kernel-akmods.sh`
- [Packages](https://github.com/ublue-os/bluefin/blob/main/build_files/base/04-packages.sh): package set · Base package installation and composition. · `build_files/base/04-packages.sh`
- [Initramfs](https://github.com/ublue-os/bluefin/blob/main/build_files/base/19-initramfs.sh): boot image · Initramfs generation and boot-critical assembly. · `build_files/base/19-initramfs.sh`
- [Cleanup](https://github.com/ublue-os/bluefin/blob/main/build_files/base/17-cleanup.sh): image hygiene · Post-install cleanup and image size reduction. · `build_files/base/17-cleanup.sh`
- [Base tests](https://github.com/ublue-os/bluefin/blob/main/build_files/base/20-tests.sh): validation · Image validation for the shared base build. · `build_files/base/20-tests.sh`
- [DX setup](https://github.com/ublue-os/bluefin/blob/main/build_files/dx/00-dx.sh): developer layer · Build-time additions for developer tooling and support. · `build_files/dx/00-dx.sh`
- [DX tests](https://github.com/ublue-os/bluefin/blob/main/build_files/dx/01-tests-dx.sh): validation · Checks for developer workflow support in the DX variant. · `build_files/dx/01-tests-dx.sh`
- [Build script](https://github.com/ublue-os/bluefin/blob/main/build_files/shared/build.sh): pipeline runner · Main build orchestration shared across image variants. · `build_files/shared/build.sh`
- [DX builder](https://github.com/ublue-os/bluefin/blob/main/build_files/shared/build-dx.sh): pipeline runner · Variant-specific build orchestration for DX images. · `build_files/shared/build-dx.sh`
- [Repo check](https://github.com/ublue-os/bluefin/blob/main/build_files/shared/validate-repos.sh): validation · Repository validation used by the build pipeline. · `build_files/shared/validate-repos.sh`

### Runtime

Filesystem overlays and first-boot customization.

- [Shared runtime](https://github.com/ublue-os/bluefin/tree/main/system_files/shared): desktop overlay · Runtime overlay applied to all images. · `system_files/shared`
- [Shared hooks](https://github.com/ublue-os/bluefin/tree/main/system_files/shared/usr/share/ublue-os): first-boot lifecycle · System, privileged, and user setup hooks for first boot. · `system_files/shared/usr/share/ublue-os`
- [Theming](https://github.com/ublue-os/bluefin/blob/main/system_files/shared/usr/share/ublue-os/user-setup.hooks.d/10-theming.sh): user setup · Applies default desktop theming and prompt styling. · `system_files/shared/usr/share/ublue-os/user-setup.hooks.d/10-theming.sh`
- [Tailscale](https://github.com/ublue-os/bluefin/blob/main/system_files/shared/usr/share/ublue-os/privileged-setup.hooks.d/10-tailscale.sh): privileged setup · Privileged setup for Tailscale integration. · `system_files/shared/usr/share/ublue-os/privileged-setup.hooks.d/10-tailscale.sh`
- [Flatpaks](https://github.com/ublue-os/bluefin/blob/main/system_files/shared/usr/share/ublue-os/privileged-setup.hooks.d/99-flatpaks.sh): privileged setup · Provisions Flatpak defaults and removes Fedora remotes. · `system_files/shared/usr/share/ublue-os/privileged-setup.hooks.d/99-flatpaks.sh`
- [Framework](https://github.com/ublue-os/bluefin/blob/main/system_files/shared/usr/share/ublue-os/system-setup.hooks.d/10-framework.sh): system setup · Hardware support setup for Framework systems. · `system_files/shared/usr/share/ublue-os/system-setup.hooks.d/10-framework.sh`
- [Runtime services](https://github.com/ublue-os/bluefin/tree/main/system_files/shared): desktop defaults · GNOME extensions, rpm-ostreed config, prompt profile, and service units. · `system_files/shared`
- [DX runtime](https://github.com/ublue-os/bluefin/tree/main/system_files/dx): developer overlay · Developer-focused runtime customization and service support. · `system_files/dx`
- [VS Code](https://github.com/ublue-os/bluefin/blob/main/system_files/dx/etc/skel/.config/Code/User/settings.json): user config · Preconfigured editor settings for developer workflows. · `system_files/dx/etc/skel/.config/Code/User/settings.json`
- [DX hooks](https://github.com/ublue-os/bluefin/blob/main/system_files/dx/usr/share/ublue-os/user-setup.hooks.d/10-vscode.sh): user setup · User-level DX setup performed on first login. · `system_files/dx/usr/share/ublue-os/user-setup.hooks.d/10-vscode.sh`
- [VFIO](https://github.com/ublue-os/bluefin/blob/main/system_files/dx/usr/lib/dracut/dracut.conf.d/80-vfio.conf): dracut config · Initramfs configuration for virtualization passthrough support. · `system_files/dx/usr/lib/dracut/dracut.conf.d/80-vfio.conf`
- [VM services](https://github.com/ublue-os/bluefin/tree/main/system_files/dx/usr/lib/systemd/system): service layer · Systemd and tmpfiles units for Incus, libvirt, and swtpm workarounds. · `system_files/dx/usr/lib/systemd/system`
- [Docker sysctl](https://github.com/ublue-os/bluefin/blob/main/system_files/dx/usr/lib/sysctl.d/docker-ce.conf): kernel tuning · Sysctl tuning for Docker-related developer workflows. · `system_files/dx/usr/lib/sysctl.d/docker-ce.conf`

### Release

Automation for validation, publishing, and signed delivery.

- [Release pipeline](https://github.com/ublue-os/bluefin/blob/main/.github/workflows): github actions · Build, validation, cleanup, and release automation. · `.github/workflows`
- [Image builds](https://github.com/ublue-os/bluefin/blob/main/.github/workflows/build-images.yml): workflow set · Stable, latest-main, beta, and reusable image build workflows. · `.github/workflows/build-images.yml`
- [Release flow](https://github.com/ublue-os/bluefin/blob/main/.github/workflows/generate-release.yml): workflow · Generates releases and distribution artifacts. · `.github/workflows/generate-release.yml`
- [Validation](https://github.com/ublue-os/bluefin/blob/main/.github/workflows/validate-renovate.yml): workflow · Workflow validation, including Renovate checks and cleanup. · `.github/workflows/validate-renovate.yml`
- [Cosign key](https://github.com/ublue-os/bluefin/blob/main/cosign.pub): signature trust · Public key used for signed image delivery. · `cosign.pub`
- [Versions](https://github.com/ublue-os/bluefin/blob/main/image-versions.yml): release pins · Version pinning and image release metadata. · `image-versions.yml`

## Connections

- Containerfile → Build script: builds via · Container build entrypoint invokes shared build orchestration.
- Build script → Shared build: uses · Shared build helpers are consumed by the main build pipeline.
- Shared build → Base build: orchestrates · Shared scripts orchestrate the shared base image assembly.
- Shared build → DX build: orchestrates · Shared scripts orchestrate the developer variant assembly.
- Base build → Image info: includes · Base image metadata is part of the core composition.
- Base build → Kernel/akmods: includes · Kernel and akmods are installed during base image build.
- Base build → Packages: includes · Base packages are assembled into the shared image.
- Base build → Initramfs: includes · Initramfs content is generated for bootability.
- Base build → Cleanup: includes · Cleanup stages keep the image lean and safe.
- Base build → Base tests: validates · Base image tests verify the shared OS layer.
- DX build → DX setup: extends · DX build layer adds developer-oriented components.
- DX build → DX tests: validates · DX tests verify developer workflow support.
- DX build → DX builder: orchestrates · Variant-specific build orchestration for DX images.
- Shared build → Repo check: checks · Repository validation is part of shared build hygiene.
- Shared runtime → Shared hooks: contains · Shared runtime includes the first-boot hook lifecycle.
- Shared hooks → Theming: applies · User setup hook configures theming and shell defaults.
- Shared hooks → Tailscale: applies · Privileged hook configures Tailscale.
- Shared hooks → Flatpaks: applies · Privileged hook provisions Flatpak defaults.
- Shared hooks → Framework: applies · System setup hook adds Framework-specific support.
- Shared runtime → Runtime services: contains · Shared runtime bundles desktop services and GNOME extensions.
- DX runtime → VS Code: contains · DX runtime preconfigures VS Code for the user.
- DX runtime → DX hooks: contains · DX user setup hook completes developer environment provisioning.
- DX runtime → VFIO: contains · DX runtime modifies initramfs for VFIO workflows.
- DX runtime → VM services: contains · DX runtime ships service and tmpfiles workarounds.
- DX runtime → Docker sysctl: contains · DX runtime adds Docker-related sysctl tuning.
- Release pipeline → Image builds: drives · Workflows build stable, latest-main, beta, and reusable images.
- Release pipeline → Release flow: drives · Release workflow publishes distributable artifacts.
- Release pipeline → Validation: drives · Validation workflow covers cleanup and Renovate checks.
- Release pipeline → Cosign key: uses · Release pipeline relies on the signing key trust anchor.
- Release pipeline → Versions: uses · Version pinning feeds the distribution pipeline.
- Shared build → Shared runtime: packages · Build-time assembly consumes the runtime overlay inputs.
- Shared build → DX runtime: packages · DX build assembles the DX runtime overlay.
- Release pipeline → Containerfile: builds · GitHub Actions invoke the containerized build.
