# willbush/system architecture

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

## Overview

##### Main Components

a) System Layer:
- NixOS Base System (core component)
- Impermanence Setup with tmpfs root
- LUKS Encryption Layer

b) Configuration Management:
- Flakes System
- Home Manager
- Nix-Sops (Secrets Management)

c) Major Configuration Groups:
- Host Configurations
- User Configurations
- Service Configurations
- Home Manager Profiles
- Application Configurations

##### Component Relationships

- Flakes managing the overall configuration
- Home Manager controlling user environments
- Configuration files being symlinked to appropriate locations
- Secrets management flow
- Service dependencies

##### Specific Implementation Details

Create distinct sections for:

a) Core System Configuration:
**hosts/ ─────► profiles/nixos/ ─────► modules/services/**
- ► users/ ────► profiles/home/

b) Application Configurations:
**configs/**
- ► emacs/
- ► nvim/
- ► hypr/
- ► keyboard-firmware/

##### Important Elements to Highlight

- Impermanence setup with tmpfs
- LUKS encryption layer
- Home Manager integration
- Service configurations
- Application-specific configurations
- Secret management

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph System
        nixos["NixOS Base System"]:::system
        luks["LUKS Encryption"]:::security
        tmpfs["Impermanence/tmpfs"]:::system
        efi["EFI Boot"]:::system
    end

    subgraph ConfigManagement
        flakes["Flakes System"]:::config
        homemanager["Home Manager"]:::config
        secrets["Secrets Management"]:::security
    end

    subgraph Configurations
        direction TB
        hosts["Host Configurations"]:::config
        users["User Configurations"]:::config
        services["Service Configurations"]:::config
    end

    subgraph Applications
        direction TB
        emacs["Emacs"]:::app
        nvim["Neovim"]:::app
        hypr["Hyprland"]:::app
        keyboard["Keyboard Firmware"]:::app
    end

    subgraph CoreUserPrograms
        direction TB
        shell["Shell (Fish)"]:::program
        git["Git"]:::program
        subgraph Packages
            clipkgs["CLI Packages"]:::program
            guipkgs["GUI Packages"]:::program
        end
    end

    subgraph SystemServices
        direction TB
        virt["Virtualization"]:::service
        docker["Docker"]:::service
        subgraph HardwareControl
            openrgb["OpenRGB"]:::service
            lianli["Lian Li PWM"]:::service
        end
    end

    nixos --> luks
    luks --> tmpfs
    nixos --> efi

    flakes --> nixos
    flakes --> homemanager
    homemanager --> secrets

    hosts --> nixos
    users --> homemanager
    services --> nixos

    homemanager --> Applications
    homemanager --> CoreUserPrograms
    services --> SystemServices

    %% Component Mappings
    click nixos "https://github.com/willbush/system/blob/main/profiles/nixos/nix-settings.nix"
    click tmpfs "https://github.com/willbush/system/blob/main/profiles/nixos/persist.nix"
    click efi "https://github.com/willbush/system/blob/main/profiles/nixos/efi.nix"
    click flakes "https://github.com/willbush/system/blob/main/flake.nix"
    click homemanager "https://github.com/willbush/system/tree/main/profiles/home/"
    click secrets "https://github.com/willbush/system/blob/main/secrets/secrets.yaml"
    click hosts "https://github.com/willbush/system/tree/main/hosts/"
    click users "https://github.com/willbush/system/blob/main/users/will.nix"
    click services "https://github.com/willbush/system/tree/main/modules/services/"
    click emacs "https://github.com/willbush/system/tree/main/configs/emacs/default/"
    click nvim "https://github.com/willbush/system/tree/main/configs/nvim/"
    click hypr "https://github.com/willbush/system/blob/main/configs/hypr/hyprland.conf"
    click keyboard "https://github.com/willbush/system/tree/main/configs/keyboard-firmware/"
    click shell "https://github.com/willbush/system/blob/main/profiles/home/fish.nix"
    click git "https://github.com/willbush/system/blob/main/profiles/home/git.nix"
    click clipkgs "https://github.com/willbush/system/blob/main/profiles/home/pkgs/cli.nix"
    click guipkgs "https://github.com/willbush/system/blob/main/profiles/home/pkgs/gui.nix"
    click virt "https://github.com/willbush/system/blob/main/modules/services/virt.nix"
    click docker "https://github.com/willbush/system/blob/main/modules/services/docker.nix"
    click openrgb "https://github.com/willbush/system/blob/main/modules/services/openrgb.nix"
    click lianli "https://github.com/willbush/system/blob/main/modules/services/lianli-pwm-rgb-sync.nix"

    classDef system fill:#3498db,stroke:#2980b9,color:white
    classDef security fill:#e74c3c,stroke:#c0392b,color:white
    classDef config fill:#2ecc71,stroke:#27ae60,color:white
    classDef app fill:#9b59b6,stroke:#8e44ad,color:white
    classDef program fill:#f1c40f,stroke:#f39c12,color:black
    classDef service fill:#e67e22,stroke:#d35400,color:white
```
