# awlsring/nix-config architecture

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

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

## Overview

##### Main Components Organization

a) Configuration Layer (Top Level)
- "machines" at the top, divided into two categories:
- Servers (conflux, dominaria, innistrad, etc.)
- Workstations (chad, chungus)

b) Modules Layer (Middle Level)
Create three parallel tracks:
- System Modules
- Home Modules
- Common Modules

c) Infrastructure Layer (Bottom Level)
- Package definitions
- Overlays
- Secrets management

##### Specific Component Details

For Servers:
- Services by type (monitoring, web services, etc.)
- Hardware configurations
- Specialized services (docker-frigate, home-assistant)

For Workstations:
- Window manager configurations (Hyprland)
- User-specific configurations
- Development tools and environments

##### Module Organization

System Modules:
- Service configurations (caddy, nginx, tailscale)
- Monitoring solutions (node-exporter, scrutiny-collector)

Home Modules:
- User tool configurations (neovim, tmux, shell)
- Desktop environment configurations
- Development tool setups

Create clear separations for:
- Platform-specific configurations (Darwin/Linux)
- Service definitions
- User configurations
- System configurations

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Machines
        direction TB
        subgraph Servers
            direction TB
            SRV1[Conflux]
            SRV2[Dominaria]
            SRV3[Innistrad]
            SRV4[Kaladesh]
        end
        
        subgraph Workstations
            direction TB
            WS1[Chad]
            WS2[Chungus]
        end
    end

    subgraph Modules
        direction TB
        subgraph "System Modules"
            direction TB
            SML["Linux Modules"]
            SMD["Darwin Modules"]
            SRVS["Services"]
            MON["Monitoring"]
            IMP["Impermanence"]
        end

        subgraph "Home Modules"
            direction TB
            HMC["Common"]
            HML["Linux-specific"]
            
            subgraph "Development"
                direction TB
                DEV["Dev Tools"]
                TERM["Terminal"]
                VIM["Neovim"]
                SH["Shell"]
            end
            
            subgraph "Desktop"
                direction TB
                WM["Hyprland"]
                GAME["Gaming"]
            end
        end
    end

    subgraph Infrastructure
        direction TB
        PKG["Package Definitions"]
        OVL["Overlays"]
        SEC["Secrets Management"]
        HW["Hardware Configs"]
        DOCK["Docker Services"]
        SCRIPT["Custom Scripts"]
    end

    %% Connections
    Servers --> SML
    Servers --> SRVS
    Servers --> MON
    Servers --> HW
    Servers --> DOCK
    
    Workstations --> SML
    Workstations --> HW
    Workstations --> WM
    Workstations --> GAME
    
    SML --> PKG
    SMD --> PKG
    SRVS --> SEC
    
    HMC --> DEV
    HMC --> TERM
    HMC --> VIM
    HMC --> SH
    
    %% Component Mappings
    click Servers "https://github.com/awlsring/nix-config/tree/main/machines/servers"
    click Workstations "https://github.com/awlsring/nix-config/tree/main/machines/workstations"
    click SML "https://github.com/awlsring/nix-config/tree/main/modules/system/linux"
    click SMD "https://github.com/awlsring/nix-config/tree/main/modules/system/darwin"
    click HMC "https://github.com/awlsring/nix-config/tree/main/modules/home"
    click SRVS "https://github.com/awlsring/nix-config/tree/main/modules/system/linux/services"
    click MON "https://github.com/awlsring/nix-config/tree/main/modules/system/linux/monitoring"
    click WM "https://github.com/awlsring/nix-config/tree/main/modules/home/linux/hyprland"
    click DEV "https://github.com/awlsring/nix-config/tree/main/modules/home/common/dev"
    click SH "https://github.com/awlsring/nix-config/tree/main/modules/home/common/shell"
    click VIM "https://github.com/awlsring/nix-config/tree/main/modules/home/common/neovim"
    click SEC "https://github.com/awlsring/nix-config/blob/main/secrets/secrets.yaml"
    click PKG "https://github.com/awlsring/nix-config/tree/main/pkgs"
    click OVL "https://github.com/awlsring/nix-config/tree/main/overlays"
    click IMP "https://github.com/awlsring/nix-config/tree/main/modules/system/linux/impermanence"
    click DOCK "https://github.com/awlsring/nix-config/blob/main/machines/servers/kaladesh/docker-*.nix"
    click TERM "https://github.com/awlsring/nix-config/tree/main/modules/home/common/terminal"
    click GAME "https://github.com/awlsring/nix-config/tree/main/modules/home/linux/gaming"
    click HW "https://github.com/awlsring/nix-config/blob/main/machines/*/hardware-configuration.nix"
    click SCRIPT "https://github.com/awlsring/nix-config/tree/main/pkgs/nix-rebuil"

    classDef default fill:#f9f9f9,stroke:#333,stroke-width:2px;
    classDef server fill:#e1f5fe,stroke:#0288d1;
    classDef workstation fill:#f3e5f5,stroke:#7b1fa2;
    classDef module fill:#e8f5e9,stroke:#388e3c;
    classDef infra fill:#fff3e0,stroke:#f57c00;
    classDef service fill:#fbe9e7,stroke:#d84315;

    class SRV1,SRV2,SRV3,SRV4 server;
    class WS1,WS2 workstation;
    class SML,SMD,SRVS,MON,IMP,HMC,HML,DEV,TERM,VIM,SH,WM,GAME module;
    class PKG,OVL,SEC,HW,DOCK,SCRIPT infra;
```
