# megaaa13/nix-dots architecture

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

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

## Overview

##### Main Components
- Nix Flake and Overall Configuration: At the top level, you have the flake.nix file and flake.lock which manage dependencies and the overall “flake” that ties everything together.
- Hyprland Desktop Environment: The home/hyprland directory encapsulates the configuration for the compositor (Hyprland) and its related components (hypr, hypridle, hyprlock, rofi themes, waybar configuration, and accompanying scripts). This is crucial given the README specifications.
- NixOS Hosts & Modules: The nixos directory is structured into “hosts”, which are specific configurations for different machines (homelab, laptop, tower) along with global settings. Additionally, the nixos/modules directory contains extra configuration modules (e.g., bluetooth, minecraft, python, secureboot, steam) that are likely reused across the various host systems.
- Additional Shell Environments: The nix-shells folder provides dedicated environments (e.g., c-shell, watlab-shell) that show how the configuration can manage testing or specialized shells.

##### Relationships and Interactions
- The flake.nix and flake.lock define the overall environment, pulling together the home configuration and the system-level configuration.
- The nix-shells illustrate auxiliary tools that might be used to test or run isolated environments.

##### Architectural Patterns and Design Principles
- Declarative Configuration: Every component is defined declaratively via Nix expressions. Emphasize that the system follows a modular approach (note the division into “apps”, “hosts”, and “modules”) where modifications in one module automatically cascade to dependent configurations.
- Separation of Concerns: The project is cleanly separated into system-level settings (nixos/hosts and nixos/modules) and user-level settings (home/apps, home/hyprland). This modularity provides clear boundaries and facilitates easier maintenance or customization.
- Customization and Reusability: The use of Nix flakes, modular host configurations, and separate shell environments shows that the project is geared towards high customization and reusability across different setups.

##### Relevant Technologies, Frameworks, or Libraries
- Nix and NixOS – the foundation for declarative system configuration.
- Hyprland, Waybar, Rofi, kitty, zsh, and others form the user desktop ecosystem.
- SecureBoot is referenced in the README, meaning that some configurations address security (as seen within the nixos/modules/secureboot.nix).
- The repository also includes assets (screenshots, etc.) that serve as visual documentation.

## Diagram (Mermaid)

```mermaid
graph TD
  %% Overall Flake Configuration
  subgraph "Overall Flake Configuration"
    direction TB
    FN["flake.nix"]:::system
    FL["flake.lock"]:::system
  end

  %% System Configuration Layer
  subgraph "System Configuration"
    direction TB
    NM["NixOS Modules"]:::system
    NH["NixOS Hosts"]:::system
  end

  %% User Environment Layer
  subgraph "User Environment"
    direction TB
    HA["Home Applications"]:::user
    HD["Hyprland Desktop Environment"]:::user
    subgraph "Hyprland Components"
      direction TB
      HC["Hyprland Compositor"]:::user
      HI["Hyprland Idle Service"]:::user
      HL["Hyprland Lock Screen"]:::user
      RT["Rofi Themes"]:::user
      WC["Waybar Configuration"]:::user
    end
  end

  %% Additional Shell Environments
  AS["Additional Shell Environments"]:::user

  %% Connections from Overall Flake to System and User Layers
  FN -->|"defines"| NM
  FL -->|"defines"| NM
  NM -->|"configures"| NH
  FN -->|"defines"| HA
  FL -->|"defines"| HA
  FN -->|"defines"| AS
  FL -->|"defines"| AS

  %% Connections within Hyprland Environment
  HD -->|"composes"| HC
  HD -->|"composes"| HI
  HD -->|"composes"| HL
  HD -->|"composes"| RT
  HD -->|"composes"| WC

  %% Styles
  classDef system fill:#ADD8E6,stroke:#000,stroke-width:2px;
  classDef user fill:#90EE90,stroke:#000,stroke-width:2px;

  %% Click Events
  click FN "https://github.com/megaaa13/nix-dots/blob/main/flake.nix"
  click FL "https://github.com/megaaa13/nix-dots/blob/main/flake.lock"
  click HA "https://github.com/megaaa13/nix-dots/tree/main/home/apps"
  click HD "https://github.com/megaaa13/nix-dots/tree/main/home/hyprland"
  click HC "https://github.com/megaaa13/nix-dots/tree/main/home/hyprland/hypr"
  click HI "https://github.com/megaaa13/nix-dots/tree/main/home/hyprland/hypridle"
  click HL "https://github.com/megaaa13/nix-dots/tree/main/home/hyprland/hyprlock"
  click RT "https://github.com/megaaa13/nix-dots/tree/main/home/hyprland/rofi"
  click WC "https://github.com/megaaa13/nix-dots/tree/main/home/hyprland/waybar"
  click NH "https://github.com/megaaa13/nix-dots/tree/main/nixos/hosts"
  click NM "https://github.com/megaaa13/nix-dots/tree/main/nixos/modules"
  click AS "https://github.com/megaaa13/nix-dots/tree/main/nix-shells"
```
