# coffnix/coffnix-ebuilds architecture

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

- Interactive diagram: https://gitdiagram.com/coffnix/coffnix-ebuilds
- Repository: https://github.com/coffnix/coffnix-ebuilds

## Overview

This repository is a Gentoo/Funtoo Portage overlay, not an application runtime. Its job is to define, patch, and package third-party software so it can be installed by `emerge` from a local overlay repository.

The top-level structure is category-first: each directory such as `sys-apps`, `net-misc`, `dev-qt`, `kde-plasma`, `x11-*`, and `media-*` maps to a Portage package category. Under each package directory are versioned `.ebuild` files, a `Manifest`, and often a `files/` directory with patches, init scripts, service units, config templates, or desktop integration files.

The main data flow is: upstream source release or VCS snapshot → ebuild recipe in this overlay → patches and local install files from `files/` → Portage resolves dependencies and builds/installs the package into the target system. For many packages, the overlay also carries service wiring for OpenRC or systemd so the installed software becomes a boot-time daemon.

`eclass/` is the shared build logic layer. It contains reusable Gentoo build helpers for ecosystems like Meson, CMake, Rust, Cargo, Python, KDE, Qt, XDG, NVIDIA, and others. These eclasses are the main abstraction boundary that keeps many package recipes small and consistent.

A second abstraction layer is the generated-package workflow. Several packages use `autogen.yaml`, `autogen.py`, `generator.py`, and `templates/` to produce multiple ebuilds or version variants from a common template. This is used heavily for large families such as Qt, KDE Frameworks/Plasma, Rust, Python, NodeJS, and some system utilities.

`metadata/` is mostly generated Portage cache and repository metadata. `metadata/md5-cache/` mirrors package metadata for faster dependency resolution; it is derived output rather than primary source. `profiles/` defines the repo identity, category list, and package masks/unmasks used by Portage when this overlay is enabled.

The repository has a strong “distro integration” subsystem: many packages ship distro-specific service files, init scripts, tmpfiles, udev rules, PAM snippets, logrotate configs, and default configuration files. Examples include `net-analyzer/zabbix`, `net-dns/unbound`, `net-misc/openssh`, `sys-apps/openrc`, `sys-auth/elogind`, and `kde-plasma/*` session components. These files are the boundary between build-time packaging and system boot/runtime behavior.

Another major subsystem is patch maintenance. Many packages carry targeted patches for compiler compatibility, libc/toolchain changes, security fixes, and feature enablement. Examples include GCC/Clang fixes, musl and LibreSSL compatibility, kernel-version compatibility, and backports for upstream bugs. The overlay is therefore both a package source and a downstream patch set.

The repository also encodes a few large technology stacks as coordinated package groups rather than isolated packages: KDE Frameworks/Plasma, LXQt, GNOME, Xlibre/Xorg, GStreamer/PulseAudio/PipeWire, and crypto/TPM tooling. Within each stack, many packages are version-aligned and depend on shared libraries built elsewhere in the overlay.

`funtoo-hardened/` is a custom system-profile bundle: it contains hardened boot/network/profile defaults, nftables rules, Portage configuration, and kernel configs. This acts more like a deployment policy layer than a software package layer, and it shows the overlay is intended to bootstrap or tune whole systems, not just individual apps.

`xlibre-*` and `kde-*`/`lxqt-*` namespaces indicate the overlay carries alternative or updated desktop infrastructure, including display server packages, input/video drivers, and desktop session components. These directories are important architectural boundaries because they represent platform stacks with their own dependency trees and runtime services.

For a diagram, the key external systems are the Portage package manager, upstream source projects, and the target host’s init/service manager. Internally, the important nodes are: package recipes (`.ebuild`), shared build logic (`eclass`), package-local patches/configs (`files/`), generated metadata (`metadata/md5-cache`), and repo policy/profile files (`profiles/`).

Main entry points: [`app-admin/syslog-ng/syslog-ng-4.10.2.ebuild`](https://github.com/coffnix/coffnix-ebuilds/blob/master/app-admin/syslog-ng/syslog-ng-4.10.2.ebuild) (Ebuilds), [`eclass/meson.eclass`](https://github.com/coffnix/coffnix-ebuilds/blob/master/eclass/meson.eclass) (Eclasses), [`net-dns/unbound/files/unbound.service`](https://github.com/coffnix/coffnix-ebuilds/blob/master/net-dns/unbound/files/unbound.service) (Service wiring), [`kde-plasma/plasma-meta/plasma-meta-5.91.0.ebuild`](https://github.com/coffnix/coffnix-ebuilds/blob/master/kde-plasma/plasma-meta/plasma-meta-5.91.0.ebuild) (KDE stack)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g_external["External systems"]
  node_n_portage["Portage<br/>package manager"]
  node_n_upstream["Upstream<br/>source projects"]
  node_n_target["Target host<br/>runtime system"]
  node_n_openrc["OpenRC<br/>init system"]
  node_n_systemd["systemd<br/>service manager"]
end

subgraph group_g_overlay["Overlay source tree"]
  node_n_ebuilds["Ebuilds<br/>package recipes"]
  node_n_patches["Files & patches<br/>local overlays<br/>[sshd.service]"]
  node_n_manifests["Manifests<br/>checksums"]
end

subgraph group_g_build["Build abstractions"]
  node_n_eclasses["Eclasses<br/>shared build logic<br/>[meson.eclass]"]
  node_n_generators["Generators<br/>template workflow<br/>[autogen.yaml]"]
end

subgraph group_g_policy["Repo policy"]
  node_n_profiles["Profiles<br/>repo policy"]
  node_n_metadata[("Md5 cache<br/>generated metadata")]
  node_n_hardened["Hardened profile<br/>system policy bundle<br/>[make.conf]"]
end

subgraph group_g_stacks["Coordinated stacks"]
  node_n_kde["KDE stack<br/>desktop suite"]
  node_n_lxqt["LXQt stack<br/>desktop suite"]
  node_n_xlibre["Xlibre stack<br/>display stack"]
  node_n_media_net["Media & net<br/>core runtime stack"]
  node_n_security["Security tools<br/>crypto/TPM stack"]
end

subgraph group_g_distro["Distro integration"]
  node_n_services["Service wiring<br/>boot integration<br/>[unbound.service]"]
end

node_n_upstream -->|"source inputs"| node_n_ebuilds
node_n_ebuilds -->|"patched by"| node_n_patches
node_n_ebuilds -->|"locked by"| node_n_manifests
node_n_eclasses -->|"shared logic"| node_n_ebuilds
node_n_generators -->|"emits"| node_n_ebuilds
node_n_profiles -->|"configures"| node_n_portage
node_n_metadata -->|"speeds up"| node_n_portage
node_n_hardened -->|"extends"| node_n_profiles
node_n_portage -->|"builds"| node_n_ebuilds
node_n_portage -->|"installs into"| node_n_target
node_n_ebuilds -->|"ships"| node_n_services
node_n_services -->|"targets"| node_n_openrc
node_n_services -->|"targets"| node_n_systemd
node_n_kde -->|"uses KDE helpers"| node_n_eclasses
node_n_lxqt -->|"uses Qt helpers"| node_n_eclasses
node_n_xlibre -->|"uses X helpers"| node_n_eclasses
node_n_media_net -->|"uses shared build"| node_n_eclasses
node_n_security -->|"uses crypto helpers"| node_n_eclasses
node_n_kde -->|"session wiring"| node_n_services
node_n_media_net -->|"daemon wiring"| node_n_services
node_n_security -->|"protects"| node_n_target

click node_n_ebuilds "https://github.com/coffnix/coffnix-ebuilds/blob/master/app-admin/syslog-ng/syslog-ng-4.10.2.ebuild"
click node_n_patches "https://github.com/coffnix/coffnix-ebuilds/blob/master/net-misc/openssh/files/sshd.service"
click node_n_manifests "https://github.com/coffnix/coffnix-ebuilds/tree/master/app-admin/syslog-ng/Manifest"
click node_n_eclasses "https://github.com/coffnix/coffnix-ebuilds/blob/master/eclass/meson.eclass"
click node_n_generators "https://github.com/coffnix/coffnix-ebuilds/blob/master/dev-qt/autogen.yaml"
click node_n_profiles "https://github.com/coffnix/coffnix-ebuilds/tree/master/profiles/repo_name"
click node_n_metadata "https://github.com/coffnix/coffnix-ebuilds/tree/master/metadata/md5-cache"
click node_n_hardened "https://github.com/coffnix/coffnix-ebuilds/blob/master/funtoo-hardened/etc/portage/make.conf"
click node_n_kde "https://github.com/coffnix/coffnix-ebuilds/blob/master/kde-plasma/plasma-meta/plasma-meta-5.91.0.ebuild"
click node_n_lxqt "https://github.com/coffnix/coffnix-ebuilds/blob/master/lxqt-base/lxqt-meta/lxqt-meta-2.3.0.ebuild"
click node_n_xlibre "https://github.com/coffnix/coffnix-ebuilds/blob/master/xlibre-base/xorg-server/xorg-server-25.1.5.ebuild"
click node_n_media_net "https://github.com/coffnix/coffnix-ebuilds/blob/master/media-libs/gstreamer/gstreamer-1.24.11.ebuild"
click node_n_security "https://github.com/coffnix/coffnix-ebuilds/blob/master/app-crypt/tpm2-tools/tpm2-tools-5.4.ebuild"
click node_n_services "https://github.com/coffnix/coffnix-ebuilds/blob/master/net-dns/unbound/files/unbound.service"

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_n_portage,node_n_upstream,node_n_target,node_n_openrc,node_n_systemd toneBlue
class node_n_ebuilds,node_n_patches,node_n_manifests toneAmber
class node_n_eclasses,node_n_generators toneMint
class node_n_profiles,node_n_metadata,node_n_hardened toneRose
class node_n_kde,node_n_lxqt,node_n_xlibre,node_n_media_net,node_n_security toneIndigo
class node_n_services toneTeal
```

## Components

### External systems

Upstream sources, Portage, and the target host runtime that the overlay feeds.

- **Portage**: package manager · Resolves dependencies, applies ebuild logic, and builds packages from the overlay.
- **Upstream**: source projects · Release tarballs, VCS snapshots, and vendored third-party projects consumed by recipes.
- **Target host**: runtime system · The installed Gentoo/Funtoo system where daemons, desktop stacks, and policy take effect.
- **OpenRC**: init system · Boot and service manager targeted by many init scripts and conf.d files.
- **systemd**: service manager · Alternative runtime/service target for installed units, tmpfiles, and daemon wiring.

### Overlay source tree

Category-first ebuild packages and their local patches/files.

- [Ebuilds](https://github.com/coffnix/coffnix-ebuilds/blob/master/app-admin/syslog-ng/syslog-ng-4.10.2.ebuild): package recipes · Versioned package definitions spread across category directories such as sys-apps, net-misc, dev-qt, and x11-*. · `app-admin/syslog-ng/syslog-ng-4.10.2.ebuild`
- [Files & patches](https://github.com/coffnix/coffnix-ebuilds/blob/master/net-misc/openssh/files/sshd.service): local overlays · Patch sets, init scripts, service units, templates, and install-time config shipped with packages. · `net-misc/openssh/files/sshd.service`
- [Manifests](https://github.com/coffnix/coffnix-ebuilds/tree/master/app-admin/syslog-ng/Manifest): checksums · Per-package Manifest files that pin distfiles and local files used by Portage. · `app-admin/syslog-ng/Manifest`

### Build abstractions

Shared eclasses and generated-package workflows used by many recipes.

- [Eclasses](https://github.com/coffnix/coffnix-ebuilds/blob/master/eclass/meson.eclass): shared build logic · Reusable Gentoo build helpers for Meson, CMake, Rust, Qt/KDE, XDG, OpenRC, and more. · `eclass/meson.eclass`
- [Generators](https://github.com/coffnix/coffnix-ebuilds/blob/master/dev-qt/autogen.yaml): template workflow · autogen.yaml, autogen.py, generator.py, and templates that emit families of ebuilds. · `dev-qt/autogen.yaml`

### Repo policy

Profiles and generated metadata that steer Portage behavior.

- [Profiles](https://github.com/coffnix/coffnix-ebuilds/tree/master/profiles/repo_name): repo policy · Repository identity, category list, masks, and overlay policy for Portage. · `profiles/repo_name`
- [Md5 cache](https://github.com/coffnix/coffnix-ebuilds/tree/master/metadata/md5-cache): generated metadata · Derived Portage metadata cache used to speed dependency resolution. · `metadata/md5-cache`
- [Hardened profile](https://github.com/coffnix/coffnix-ebuilds/blob/master/funtoo-hardened/etc/portage/make.conf): system policy bundle · Funtoo hardened defaults for boot, firewall, Portage settings, and kernel configuration. · `funtoo-hardened/etc/portage/make.conf`

### Coordinated stacks

Large aligned package families that are maintained as sets.

- [KDE stack](https://github.com/coffnix/coffnix-ebuilds/blob/master/kde-plasma/plasma-meta/plasma-meta-5.91.0.ebuild): desktop suite · Frameworks, Plasma, and supporting KDE utilities kept version-aligned as a coordinated family. · `kde-plasma/plasma-meta/plasma-meta-5.91.0.ebuild`
- [LXQt stack](https://github.com/coffnix/coffnix-ebuilds/blob/master/lxqt-base/lxqt-meta/lxqt-meta-2.3.0.ebuild): desktop suite · LXQt base, tools, and portal components maintained as an aligned desktop stack. · `lxqt-base/lxqt-meta/lxqt-meta-2.3.0.ebuild`
- [Xlibre stack](https://github.com/coffnix/coffnix-ebuilds/blob/master/xlibre-base/xorg-server/xorg-server-25.1.5.ebuild): display stack · Updated Xorg/Xlibre server and drivers, including NVIDIA and input/video components. · `xlibre-base/xorg-server/xorg-server-25.1.5.ebuild`
- [Media & net](https://github.com/coffnix/coffnix-ebuilds/blob/master/media-libs/gstreamer/gstreamer-1.24.11.ebuild): core runtime stack · Audio, video, networking, and browser-facing libraries and daemons reused across the overlay. · `media-libs/gstreamer/gstreamer-1.24.11.ebuild`
- [Security tools](https://github.com/coffnix/coffnix-ebuilds/blob/master/app-crypt/tpm2-tools/tpm2-tools-5.4.ebuild): crypto/TPM stack · Cryptography, TPM, secure boot, and related security tooling packaged by the overlay. · `app-crypt/tpm2-tools/tpm2-tools-5.4.ebuild`

### Distro integration

Boot-time, service, and system configuration wired into installed packages.

- [Service wiring](https://github.com/coffnix/coffnix-ebuilds/blob/master/net-dns/unbound/files/unbound.service): boot integration · Init scripts, service units, tmpfiles, udev rules, PAM snippets, and defaults that bridge package install to runtime behavior. · `net-dns/unbound/files/unbound.service`

## Connections

- Upstream → Ebuilds: source inputs · Recipes fetch upstream releases or VCS snapshots and turn them into buildable package definitions.
- Ebuilds → Files & patches: patched by · Package recipes apply local patches and install files from their files/ directories.
- Ebuilds → Manifests: locked by · Manifests record distfiles and local artifacts referenced by each package.
- Eclasses → Ebuilds: shared logic · Many recipes inherit common build helpers instead of duplicating build steps.
- Generators → Ebuilds: emits · Template workflows generate families of related ebuilds and version variants.
- Profiles → Portage: configures · Profiles tell Portage how to treat this overlay and which packages are masked or enabled.
- Md5 cache → Portage: speeds up · Generated md5-cache metadata is consumed by Portage for faster resolution.
- Hardened profile → Profiles: extends · The hardened bundle acts as a deployment-policy layer alongside the repository profile settings.
- Portage → Ebuilds: builds · Portage evaluates recipes to compile, merge, or install packages.
- Portage → Target host: installs into · Built packages are merged into the target host filesystem.
- Ebuilds → Service wiring: ships · Many recipes install service files and runtime defaults as part of the package payload.
- Service wiring → OpenRC: targets · OpenRC init scripts and conf.d files wire daemons into system boot.
- Service wiring → systemd: targets · Systemd units, tmpfiles, and related files wire services into modern boot/runtime behavior.
- KDE stack → Eclasses: uses KDE helpers · KDE frameworks and Plasma packages rely heavily on KDE-specific eclasses and templates.
- LXQt stack → Eclasses: uses Qt helpers · LXQt packages use shared Qt and CMake build helpers to keep the stack consistent.
- Xlibre stack → Eclasses: uses X helpers · Xlibre server and driver packages depend on Xorg/Xlibre eclasses and meson wrappers.
- Media & net → Eclasses: uses shared build · Media, networking, and browser-facing components reuse common Meson, CMake, Rust, and Python helpers.
- Security tools → Eclasses: uses crypto helpers · Security-oriented packages commonly use Rust, Cargo, and signature/secureboot helpers.
- KDE stack → Service wiring: session wiring · Plasma components contribute PAM, session, and desktop integration files.
- Media & net → Service wiring: daemon wiring · Audio, DNS, SSH, and monitoring packages contribute service units and init scripts.
- Security tools → Target host: protects · Cryptography, TPM, and secure-boot tooling operate on the target system after installation.
