# jacokok/nix architecture

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

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

## Overview

##### Main Components
- Flake/Entry Point: Represent the “flake.nix” at the heart of the project, which orchestrates the entire configuration. This file ties together the different configuration components.
– Machine-specific configurations (e.g., “doink-laptop” and “doink-pc”) with their respective configuration.nix and hardware-configuration.nix files.
– Other system-wide components like dotnet or flatpak configurations.
– User settings for dconf, files, and themes.
– A breakdown for programs (like ghostty, firefox, neovim, helix, vscode, etc.) that configure personal application settings.
- Overlays: Represent the “overlays” directory. These files (e.g., overlays/default.nix, overlays/dotnet.nix, etc.) are used to extend or modify package definitions and should be shown as feeding into the package system.
- Secrets: A smaller component for “secrets/yaml” to indicate that sensitive information is maintained separately.

##### Architectural Patterns/Design Principles
- Declarative and composable nature of the Nix configuration by highlighting that multiple layers (flake -> overlays -> pkgs -> configuration) work together.
- Separation of system-wide configuration (nixos) from user-level configuration (home-manager) and how they are assembled via the flake.
- That each component is modular, making it easy to extend or modify parts without disrupting the whole.

##### Technology and Tools
- Labels with “NixOS” and “home-manager” to reflect the core tools.
- Mention flake support which modernizes the configuration approach.
- Optionally, note that GitHub Actions are used for CI, and overlay and package mechanisms are vital to customized system builds.

## Diagram (Mermaid)

```mermaid
flowchart TD
    FLAKE("flake.nix"):::central

    subgraph "NixOS System Config"
        NIXOS_CONFIG["NixOS System Config"]:::system
        DOINK_LAPTOP["doink-laptop Config"]:::system
        DOINK_PC["doink-pc Config"]:::system
        DOTNET["dotnet.nix"]:::system
        FLATPAK["flatpak.nix"]:::system
        FONTS["Fonts"]:::system
    end

    subgraph "Home-Manager User Config"
        HOME_CONFIG["Home-Manager User Config"]:::user
        DCONF["dconf"]:::user
        FILES["files"]:::user
        HOME_NIX["home.nix"]:::user
        PROGRAMS["Programs"]:::user
        THEME["Theme"]:::user
    end

    OVERLAYS["Overlays"]:::system
    PKGS["Custom Packages"]:::system
    subgraph "Custom Packages Modules"
        ADWAITA["adwaita-for-steam"]:::system
        CSHARP["csharp"]:::system
    end

    SECRETS["Secrets"]:::system
    CI["CI Workflows"]:::ci
    BUILD["Build Script"]:::script
    INSTALL["Install Script"]:::script

    %% Relationships
    FLAKE -->|"aggregates"| NIXOS_CONFIG
    FLAKE -->|"aggregates"| HOME_CONFIG

    OVERLAYS -->|"injects"| NIXOS_CONFIG
    OVERLAYS -->|"injects"| HOME_CONFIG

    PKGS -->|"provides"| NIXOS_CONFIG
    PKGS -->|"provides"| HOME_CONFIG

    SECRETS -->|"supplies"| NIXOS_CONFIG
    SECRETS -->|"supplies"| HOME_CONFIG

    CI -->|"validates"| FLAKE
    BUILD -->|"builds"| FLAKE
    INSTALL -->|"deploys"| FLAKE

    %% NixOS internal breakdown
    NIXOS_CONFIG --> DOINK_LAPTOP
    NIXOS_CONFIG --> DOINK_PC
    NIXOS_CONFIG --> DOTNET
    NIXOS_CONFIG --> FLATPAK
    NIXOS_CONFIG --> FONTS

    %% Home-Manager internal breakdown
    HOME_CONFIG --> DCONF
    HOME_CONFIG --> FILES
    HOME_CONFIG --> HOME_NIX
    HOME_CONFIG --> PROGRAMS
    HOME_CONFIG --> THEME

    %% Custom Packages breakdown
    PKGS --> ADWAITA
    PKGS --> CSHARP

    %% Click Events
    click FLAKE "https://github.com/jacokok/nix/blob/master/flake.nix"
    click NIXOS_CONFIG "https://github.com/jacokok/nix/tree/master/nixos/"
    click DOINK_LAPTOP "https://github.com/jacokok/nix/tree/master/nixos/doink-laptop/"
    click DOINK_PC "https://github.com/jacokok/nix/tree/master/nixos/doink-pc/"
    click DOTNET "https://github.com/jacokok/nix/blob/master/nixos/dotnet.nix"
    click FLATPAK "https://github.com/jacokok/nix/blob/master/nixos/flatpak.nix"
    click FONTS "https://github.com/jacokok/nix/tree/master/nixos/fonts/"
    click HOME_CONFIG "https://github.com/jacokok/nix/tree/master/home-manager/"
    click DCONF "https://github.com/jacokok/nix/tree/master/home-manager/dconf/"
    click FILES "https://github.com/jacokok/nix/tree/master/home-manager/files/"
    click HOME_NIX "https://github.com/jacokok/nix/blob/master/home-manager/home.nix"
    click PROGRAMS "https://github.com/jacokok/nix/tree/master/home-manager/programs/"
    click THEME "https://github.com/jacokok/nix/tree/master/home-manager/theme/"
    click OVERLAYS "https://github.com/jacokok/nix/tree/master/overlays/"
    click PKGS "https://github.com/jacokok/nix/tree/master/pkgs/"
    click ADWAITA "https://github.com/jacokok/nix/tree/master/pkgs/adwaita-for-steam/"
    click CSHARP "https://github.com/jacokok/nix/tree/master/pkgs/csharp/"
    click SECRETS "https://github.com/jacokok/nix/blob/master/secrets/secrets.yaml"
    click CI "https://github.com/jacokok/nix/tree/master/.github/workflows/"
    click BUILD "https://github.com/jacokok/nix/blob/master/build.sh"
    click INSTALL "https://github.com/jacokok/nix/blob/master/install.sh"

    %% Styles
    classDef central fill:#FFD700,stroke:#333,stroke-width:2px;
    classDef system fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef user fill:#90EE90,stroke:#333,stroke-width:2px;
    classDef ci fill:#FFA500,stroke:#333,stroke-width:2px;
    classDef script fill:#DDA0DD,stroke:#333,stroke-width:2px;
```
