# dlurak/dotfiles architecture

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

- Interactive diagram: https://gitdiagram.com/dlurak/dotfiles
- Repository: https://github.com/dlurak/dotfiles

## Overview

##### Main Components
- System-Level Configuration: Represented by flake/nixOsModules and the host-specific configurations in flake/hosts. These files and folders define the hardware configuration, bootloader, network setups, and various system-level modules.
- User Environment Configuration: Found in flake/homemanagerModules, which manages user-level programs and services like git, gtk settings, hyprland/hyprlock, zsh, and more.
- Application/Tool Configurations:
- Neovim’s configuration (in the nvim directory) detailing plugins, LSP setups, custom remappings, snippets, and utilities.
- Ags configuration and other widget-based setups (under flake/noneNix/ags), which includes various custom widgets and support files (like TSX components).
- Tmux and other CLI tools that are configured as part of the user environment.
- Assets and Fonts: Stored in assets and flake/assets, showing support files (fonts, styles, screenshots) used across the configuration.

##### Relationships and Interactions
- The Nix Flake serves as the root for the entire system, orchestrating both system-level and user-level configurations.
- NixOS modules (nixOsModules and hosts) are responsible for core operating system settings and hardware adjustment, which then “feed” into the Home Manager modules that set up user-space utilities.
- The Home Manager modules further provide configuration for personal applications (like shell (zsh), tmux, and graphical applications such as Hyprland and its companions).
- Separately, application-specific configurations (Neovim, ags, etc.) interact with these system settings but are maintained in their own directories to keep a modular grouping.

##### Architectural Patterns and Design Principles
- Modular Configuration: The dotfiles are split into many small, logically partitioned modules (your nixOsModules, hommanagerModules, and separate host configurations). Each module manages one aspect of the system.
- Extensibility: Future ideas (as listed in the README for enhancements on both the laptop and Raspberry Pi) indicate the design should allow for additional service integrations (such as hosting services on the Raspberry Pi).

##### Technologies, Frameworks, and Tools
- Nix and NixOS: Central technology managing the OS configuration with Flake support.
- Home Manager: Provides user-level configuration.
- Hyprland and related modules (hyprlock, hyprpaper): Graphical environment customization.
- Neovim and Tmux: Configured separately but integrated as core tools.
- Ags: Custom widget system configured using TypeScript/TSX components to power aspects of the desktop environment.
- Multiple scripts and assets that support these configurations (e.g., custom scripts in nixOsModules/customScripts).

##### Final Detailed Steps
- Branch out to “System-Level Config (nixOsModules & hosts)” and “User Environment (Home Manager Modules)”.
- Under “User Environment,” add subcomponents for key applications: “Neovim (nvim/)”, “Tmux”, “Ags Widgets (flake/noneNix/ags)”, and others.
- A peripheral block for “Assets & Fonts” that supports both system and user configurations.
- That every block has concise annotations explaining its role (for instance, note that “Hosts (homie, nix-malina)” determine machine-specific settings).

## Diagram (Mermaid)

```mermaid
flowchart TD
    FLAKE["Nix Flake"]:::flake

    subgraph "System-Level Configuration"
        NXOS["NixOS Modules"]:::system
        HOST["Host Specific Config"]:::system
    end

    subgraph "User Environment"
        HM["Home Manager Modules"]:::user
        NEOVIM["Neovim Configuration"]:::app
        TMUX["Tmux Configuration"]:::app
        AGS["Ags Widgets"]:::app
    end

    subgraph "Assets & Fonts"
        LOCAL["Local Assets"]:::assets
        FLAKE_ASSETS["Flake Assets"]:::assets
    end

    %% Flake orchestrates system-level and user environment configurations
    FLAKE -->|"orchestrates"| NXOS
    FLAKE -->|"orchestrates"| HOST
    FLAKE -->|"orchestrates"| HM

    %% Home Manager loads application-specific configurations
    HM -->|"configures"| NEOVIM
    HM -->|"configures"| TMUX
    HM -->|"configures"| AGS

    %% Flake also provides assets used by the configurations
    FLAKE -->|"supplies"| LOCAL
    LOCAL -->|"integrates"| FLAKE_ASSETS

    %% Optional dependencies: System and user configurations use assets
    NXOS -->|"uses"| LOCAL
    HM -->|"uses"| LOCAL

    %% Click Events
    click FLAKE "https://github.com/dlurak/dotfiles/blob/master/flake/flake.nix"
    click NXOS "https://github.com/dlurak/dotfiles/tree/master/flake/nixOsModules"
    click HOST "https://github.com/dlurak/dotfiles/tree/master/flake/hosts"
    click HM "https://github.com/dlurak/dotfiles/tree/master/flake/homemanagerModules"
    click NEOVIM "https://github.com/dlurak/dotfiles/tree/master/nvim"
    click TMUX "https://github.com/dlurak/dotfiles/blob/master/flake/homemanagerModules/tmux.nix"
    click AGS "https://github.com/dlurak/dotfiles/tree/master/flake/noneNix/ags"
    click LOCAL "https://github.com/dlurak/dotfiles/tree/master/assets"
    click FLAKE_ASSETS "https://github.com/dlurak/dotfiles/tree/master/flake/assets"

    %% Styles
    classDef flake fill:#8dd3c7,stroke:#000,stroke-width:2px,stroke-dasharray: 5 5;
    classDef system fill:#ffffb3,stroke:#000,stroke-width:2px;
    classDef user fill:#fb8072,stroke:#000,stroke-width:2px;
    classDef app fill:#80b1d3,stroke:#000,stroke-width:2px;
    classDef assets fill:#fdb462,stroke:#000,stroke-width:2px;
```
