# dnswd/nixos architecture

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

- Interactive diagram: https://gitdiagram.com/dnswd/nixos
- Repository: https://github.com/dnswd/nixos

## Overview

##### Main Components

a. Core Configuration Layer
- configuration.nix (system-level configuration)
- hardware-configuration.nix (hardware-specific settings)
- home.nix (user environment configuration)
- flake.nix (reproducible builds and dependencies)

b. Configuration Modules (config/)
- Development Environment (devel/)
- Window Manager (hyprland.nix)
- Terminal Emulator (kitty.nix)
- Shell Configuration (zsh.nix)
- System Tools (tmux.nix, notification.nix)

c. Custom Packages (pkgs/)
- Neovim Configuration
- Cursor Editor

d. Library Components (lib/)
- Utility Functions
- Module Management

**┌─────────────────────────────────────────────┐**
- NixOS System Core              │
- ┤
- Configuration Layer                        │
- ┌─────────────┐ ┌────────────┐            │
- Flake.nix  │ │  Home.nix  │            │
- ┘ └────────────┘            │
- ┤
- Modules                      Libraries     │
- ┌─────────────┐            ┌──────────┐   │
- Config    │            │   Lib    │   │
- Modules    │<──────────>│ Utilities│   │
- ┘            └──────────┘   │
- ┤
- Custom Packages                            │
- ┌─────────────┐ ┌────────────┐            │
- Neovim    │ │  Cursor    │            │
- Config    │ │  Editor    │            │
- ┘ └────────────┘            │
- ┘

##### Additional Elements

- Input/output flows showing how configurations are applied
- System state management
- Relationship with NixOS modules
- Where user customizations can be applied

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Core["Core Configuration Layer"]
        Flake["Flake.nix"]:::core
        Config["Configuration.nix"]:::core
        Hardware["Hardware Configuration"]:::core
        Home["Home.nix"]:::core
        
        Flake --> Config
        Config --> Hardware
        Config --> Home
    end

    subgraph Modules["Configuration Modules"]
        DevEnv["Development Environment"]:::module
        WM["Window Manager"]:::module
        Terminal["Terminal Emulator"]:::module
        Shell["Shell Configuration"]:::module
        
        subgraph SysTools["System Tools"]
            Tmux["Terminal Multiplexer"]:::tool
            Notify["Notifications"]:::tool
            Prompt["Shell Prompt"]:::tool
        end
        
        subgraph DevTools["Development Tools"]
            Git["Git Configuration"]:::devtool
            Lang["Programming Languages"]:::devtool
        end
    end

    subgraph Packages["Custom Packages"]
        subgraph Neovim["Neovim Configuration"]
            LSP["LSP Config"]:::neovim
            LangSupport["Language Support"]:::neovim
            PluginConfig["Plugin Configs"]:::neovim
        end
        
        Cursor["Cursor Editor"]:::package
    end

    subgraph Lib["Library Components"]
        ModMgmt["Module Management"]:::lib
        Icons["Icon Handling"]:::lib
        Attrs["Attribute Utilities"]:::lib
        VimKeys["Vim Keymap Utils"]:::lib
    end

    Core --> Modules
    Modules --> Packages
    Lib --> Modules
    Lib --> Packages

    %% Component Mappings
    click Flake "https://github.com/dnswd/nixos/blob/master/flake.nix"
    click Config "https://github.com/dnswd/nixos/blob/master/configuration.nix"
    click Hardware "https://github.com/dnswd/nixos/blob/master/hardware-configuration.nix"
    click Home "https://github.com/dnswd/nixos/blob/master/home.nix"
    click DevEnv "https://github.com/dnswd/nixos/tree/master/config/devel/"
    click WM "https://github.com/dnswd/nixos/blob/master/config/hyprland.nix"
    click Terminal "https://github.com/dnswd/nixos/blob/master/config/kitty.nix"
    click Shell "https://github.com/dnswd/nixos/blob/master/config/zsh.nix"
    click Tmux "https://github.com/dnswd/nixos/blob/master/config/tmux.nix"
    click Notify "https://github.com/dnswd/nixos/blob/master/config/notification.nix"
    click Prompt "https://github.com/dnswd/nixos/blob/master/config/starship.nix"
    click Git "https://github.com/dnswd/nixos/blob/master/config/devel/git.nix"
    click Lang "https://github.com/dnswd/nixos/blob/master/config/devel/langs.nix"
    click Neovim "https://github.com/dnswd/nixos/tree/master/pkgs/neovim/"
    click LSP "https://github.com/dnswd/nixos/blob/master/pkgs/neovim/config/lsp.nix"
    click LangSupport "https://github.com/dnswd/nixos/tree/master/pkgs/neovim/lang/"
    click PluginConfig "https://github.com/dnswd/nixos/tree/master/pkgs/neovim/config/"
    click Cursor "https://github.com/dnswd/nixos/tree/master/pkgs/cursor-editor/"
    click ModMgmt "https://github.com/dnswd/nixos/blob/master/lib/modules.nix"
    click Icons "https://github.com/dnswd/nixos/blob/master/lib/icons.nix"
    click Attrs "https://github.com/dnswd/nixos/blob/master/lib/attrs.nix"
    click VimKeys "https://github.com/dnswd/nixos/blob/master/lib/vimkeymap.nix"

    %% Styling
    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef module fill:#4CAF50,stroke:#2E7D32,color:white
    classDef tool fill:#78909C,stroke:#546E7A,color:white
    classDef devtool fill:#FF9800,stroke:#F57C00,color:white
    classDef package fill:#FF5722,stroke:#D84315,color:white
    classDef neovim fill:#9C27B0,stroke:#6A1B9A,color:white
    classDef lib fill:#673AB7,stroke:#4527A0,color:white
```
