# dtgagnon/nix-config architecture

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

## Overview

##### Main Components

a. Core System Architecture:
- NixOS System Configuration Layer
- Home Manager Layer
- Hardware Configuration Layer
- User Configuration Layer

b. Module Structure:
- Home Manager Modules
- NixOS Modules
- System Modules
- Overlay System

**┌─────────────────────────────────────────────┐**
- Templates                   │
- ┘
- ↑
**┌─────────────────────────────────────────────┐**
- Packages                    │
- ┘
- ↑
**┌─────────────────────────────────────────────┐**
- Overlays                    │
- ┘
- ↑
**┌─────────────────────────────────────────────┐**
- Module Structure               │
- ┬─────────────┬────────────┤
- Home Modules  │ NixOS Modules│  Library   │
- ┴─────────────┴────────────┘
- ↑
**┌─────────────────────────────────────────────┐**
- System Configs                  │
- ┬──────────────┬───────────────┤
- Desktop    │  Spirepoint  │     Slim      │
- ┴──────────────┴───────────────┘
- ↑
**┌─────────────────────────────────────────────┐**
- Flake Entry                  │
- ┘

##### Key Relationships to Highlight

- How the flake.nix connects all components
- Relationship between system configurations and modules
- Demonstrate how home-manager configurations integrate with system configs
- Overlay system's influence on package management

##### Special Features to Emphasize

- Impermanence setup
- Disko disk management
- Stylix theming system
- Hardware-specific configurations
- Desktop environment setup (Hyprland)

##### Component Details

For each major component, include:
- Input/Output relationships
- Configuration flow
- Dependencies
- Integration points

##### Additional Elements

- Module types
- Configuration inheritance
- System architecture patterns
- Integration points with external services

Remember to include:
- Version control integration
- Build system flow
- Configuration inheritance patterns
- Security features (LUKS, impermanence)
- User environment customization

This will provide a clear understanding of how the system components work together while maintaining the appropriate level of detail for a principal software engineer to understand the architecture.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "System Architecture"
        direction TB
        
        %% Flake Entry Point
        Flake["Flake Entry"]
        
        %% System Configs Layer
        subgraph "System Configurations"
            Desktop["Desktop Config"]
            Spirepoint["Spirepoint Config"]
            Slim["Slim Config"]
        end
        
        %% Module Structure Layer
        subgraph "Module Structure"
            HomeModules["Home Manager Modules"]
            NixOSModules["NixOS Modules"]
            LibraryFuncs["Library Functions"]
        end
        
        %% Core Components Layer
        subgraph "Core Components"
            Templates["Templates"]
            Packages["Packages"]
            Overlays["Overlays"]
        end
        
        %% Special Features
        subgraph "Special Features"
            Impermanence["Impermanence"]
            Disko["Disko Management"]
            Stylix["Stylix Theming"]
            Hyprland["Hyprland Desktop"]
            Security["Security Features"]
        end
        
        %% Desktop Environment
        subgraph "Desktop Environment"
            HyprlandConfig["Hyprland Config"]
            DesktopAddons["Desktop Addons"]
            DesktopStyling["Desktop Styling"]
        end
    end
    
    %% Relationships
    Flake --> Desktop
    Flake --> Spirepoint
    Flake --> Slim
    
    Desktop --> HomeModules
    Desktop --> NixOSModules
    Desktop --> LibraryFuncs
    
    HomeModules --> Overlays
    NixOSModules --> Overlays
    
    Overlays --> Packages
    Packages --> Templates
    
    NixOSModules --> Impermanence
    NixOSModules --> Disko
    NixOSModules --> Stylix
    NixOSModules --> Hyprland
    NixOSModules --> Security
    
    HomeModules --> HyprlandConfig
    HomeModules --> DesktopAddons
    HomeModules --> DesktopStyling
    
    %% Styling
    classDef default fill:#f9f9f9,stroke:#333,stroke-width:2px
    classDef core fill:#b3d9ff,stroke:#333,stroke-width:2px
    classDef home fill:#90EE90,stroke:#333,stroke-width:2px
    classDef hardware fill:#FFB366,stroke:#333,stroke-width:2px
    classDef user fill:#DDA0DD,stroke:#333,stroke-width:2px
    classDef support fill:#E6E6E6,stroke:#333,stroke-width:2px
    
    %% Apply classes
    class Flake core
    class HomeModules home
    class NixOSModules core
    class Templates,Packages,Overlays support
    class Impermanence,Disko,Security hardware
    class HyprlandConfig,DesktopAddons,DesktopStyling user
    
    %% Click events
    click Flake "https://github.com/dtgagnon/nix-config/blob/main/flake.nix"
    click HomeModules "https://github.com/dtgagnon/nix-config/tree/main/modules/home"
    click NixOSModules "https://github.com/dtgagnon/nix-config/tree/main/modules/nixos"
    click LibraryFuncs "https://github.com/dtgagnon/nix-config/tree/main/lib"
    click Templates "https://github.com/dtgagnon/nix-config/tree/main/templates"
    click Packages "https://github.com/dtgagnon/nix-config/tree/main/packages"
    click Overlays "https://github.com/dtgagnon/nix-config/tree/main/overlays"
    click Impermanence "https://github.com/dtgagnon/nix-config/tree/main/modules/nixos/system/impermanence"
    click Disko "https://github.com/dtgagnon/nix-config/tree/main/modules/nixos/hardware/storage/disko"
    click Stylix "https://github.com/dtgagnon/nix-config/tree/main/modules/nixos/desktop/stylix"
    click Hyprland "https://github.com/dtgagnon/nix-config/tree/main/modules/nixos/desktop/hyprland"
    click Security "https://github.com/dtgagnon/nix-config/tree/main/modules/nixos/security"
    click HyprlandConfig "https://github.com/dtgagnon/nix-config/tree/main/modules/home/desktop/hyprland"
    click DesktopAddons "https://github.com/dtgagnon/nix-config/tree/main/modules/home/desktop/addons"
    click DesktopStyling "https://github.com/dtgagnon/nix-config/tree/main/modules/home/desktop/styling"
```
