# nebunebu/nix-config architecture

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

- Interactive diagram: https://gitdiagram.com/nebunebu/nix-config
- Repository: https://github.com/nebunebu/nix-config

## Overview

##### Top-Level Architecture
a. Flake Entry Point (flake.nix)
b. Host Configurations
c. Module Systems
d. Package Management
e. Secrets Management

##### Data Flow and Dependencies

- Configuration inheritance paths
- Service dependencies
- System composition flow
- Secrets management flow through sops-nix

##### Key Subsystems (Use nested containers)

a. Desktop Environment Stack:
- Hyprland (WM)
- ↓
- Wayland
- ↓
- Hardware

b. Configuration Management:
- Flake
- ↓
- Host Definitions
- ↓
- Modules (NixOS/Home-Manager)

##### Important Elements to Highlight

- Sops-nix integration for secrets management
- Stylix for system-wide theming
- Custom package definitions
- Host-specific configurations
- Development environment setup

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Core System"
        Flake["Flake Entry Point"]:::core
        click Flake "https://github.com/nebunebu/nix-config/blob/main/flake.nix"
    end

    subgraph "Host Configurations"
        T5610["Desktop (t5610)"]:::host
        X230T["Laptop (x230t)"]:::host
        click T5610 "https://github.com/nebunebu/nix-config/tree/main/hosts/t5610"
        click X230T "https://github.com/nebunebu/nix-config/tree/main/hosts/x230t"
    end

    subgraph "Module Systems"
        NixOSMods["NixOS Modules"]:::system
        HomeMods["Home Manager Modules"]:::user
        click NixOSMods "https://github.com/nebunebu/nix-config/tree/main/nixos-modules"
        click HomeMods "https://github.com/nebunebu/nix-config/tree/main/hm-modules"
    end

    subgraph "System Configuration"
        Boot["Boot Config"]:::system
        Network["Networking"]:::system
        SysSettings["System Settings"]:::system
        UserMgmt["User Management"]:::system
        click Boot "https://github.com/nebunebu/nix-config/blob/main/nixos-modules/boot.nix"
        click Network "https://github.com/nebunebu/nix-config/blob/main/nixos-modules/networking.nix"
        click SysSettings "https://github.com/nebunebu/nix-config/blob/main/nixos-modules/system.nix"
        click UserMgmt "https://github.com/nebunebu/nix-config/tree/main/nixos-modules/users"
    end

    subgraph "Desktop Environment"
        Hyprland["Hyprland WM"]:::desktop
        SDDM["SDDM"]:::desktop
        Pipewire["Pipewire"]:::desktop
        click Hyprland "https://github.com/nebunebu/nix-config/tree/main/hm-modules/desktop/window-managers/hyprland"
        click SDDM "https://github.com/nebunebu/nix-config/blob/main/nixos-modules/sddm.nix"
        click Pipewire "https://github.com/nebunebu/nix-config/blob/main/nixos-modules/pipewire.nix"
    end

    subgraph "Applications"
        Browsers["Browsers"]:::apps
        TermEmu["Terminal Emulators"]:::apps
        Media["Media Apps"]:::apps
        DevTools["Development Tools"]:::apps
        ProdTools["Productivity Tools"]:::apps
        click Browsers "https://github.com/nebunebu/nix-config/tree/main/hm-modules/desktop/browsers"
        click TermEmu "https://github.com/nebunebu/nix-config/tree/main/hm-modules/desktop/utilities"
        click Media "https://github.com/nebunebu/nix-config/tree/main/hm-modules/desktop/media"
        click DevTools "https://github.com/nebunebu/nix-config/tree/main/hm-modules/development"
        click ProdTools "https://github.com/nebunebu/nix-config/tree/main/hm-modules/desktop/productivity"
    end

    subgraph "Development Environment"
        Git["Git Config"]:::dev
        Direnv["Direnv"]:::dev
        GoTools["Go Tools"]:::dev
        click Git "https://github.com/nebunebu/nix-config/blob/main/hm-modules/development/git.nix"
        click Direnv "https://github.com/nebunebu/nix-config/blob/main/hm-modules/development/direnv.nix"
        click GoTools "https://github.com/nebunebu/nix-config/blob/main/hm-modules/development/go.nix"
    end

    subgraph "Terminal Environment"
        Shell["Shell Config"]:::term
        TermUtils["Terminal Utilities"]:::term
        FileNav["File Navigation"]:::term
        click Shell "https://github.com/nebunebu/nix-config/tree/main/hm-modules/terminal/shell"
        click TermUtils "https://github.com/nebunebu/nix-config/tree/main/hm-modules/terminal/utilities"
        click FileNav "https://github.com/nebunebu/nix-config/tree/main/hm-modules/terminal/file-navigation"
    end

    subgraph "Secrets Management"
        Sops["Sops Configuration"]:::security
        Secrets["Secrets Storage"]:::security
        click Sops "https://github.com/nebunebu/nix-config/tree/main/sops"
        click Secrets "https://github.com/nebunebu/nix-config/blob/main/sops/secrets/secrets.yaml"
    end

    subgraph "Hardware Configuration"
        AMDGPU["AMD GPU"]:::hardware
        HWConfig["Hardware Configs"]:::hardware
        click AMDGPU "https://github.com/nebunebu/nix-config/blob/main/nixos-modules/amdgpu.nix"
        click HWConfig "https://github.com/nebunebu/nix-config/blob/main/hosts/t5610/nixOS/hardware-configuration.nix"
    end

    %% Connections
    Flake --> T5610
    Flake --> X230T
    T5610 --> NixOSMods
    T5610 --> HomeMods
    X230T --> NixOSMods
    X230T --> HomeMods
    NixOSMods --> Boot
    NixOSMods --> Network
    NixOSMods --> SysSettings
    NixOSMods --> UserMgmt
    HomeMods --> Hyprland
    NixOSMods --> SDDM
    NixOSMods --> Pipewire
    HomeMods --> Browsers
    HomeMods --> TermEmu
    HomeMods --> Media
    HomeMods --> DevTools
    HomeMods --> ProdTools
    HomeMods --> Git
    HomeMods --> Direnv
    HomeMods --> GoTools
    HomeMods --> Shell
    HomeMods --> TermUtils
    HomeMods --> FileNav
    T5610 --> Sops
    X230T --> Sops
    Sops --> Secrets
    T5610 --> AMDGPU
    T5610 --> HWConfig
    X230T --> HWConfig

    %% Styles
    classDef core fill:#f9f,stroke:#333,stroke-width:2px
    classDef host fill:#ffa500,stroke:#333
    classDef system fill:#b4d8e7,stroke:#333
    classDef user fill:#98fb98,stroke:#333
    classDef desktop fill:#dda0dd,stroke:#333
    classDef apps fill:#87ceeb,stroke:#333
    classDef dev fill:#f0e68c,stroke:#333
    classDef term fill:#e6e6fa,stroke:#333
    classDef security fill:#ff6b6b,stroke:#333
    classDef hardware fill:#ffa07a,stroke:#333
```
