# tshm/dotfiles architecture

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

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

## Overview

##### Main Components Organization

a. Core Configuration Management
- Divide into distinct configuration domains (homes, hosts, services)

b. Environment-Specific Configurations
- Different target environments (PD0056, PN0093, minf, spi, usb, x360)
- To their respective configuration modules

##### Key Architectural Elements

a. NixOS Configuration Layer
- Relationship between flake.nix and the homes/hosts structure
- How the module system works (base.nix, dev.nix, gui.nix, wsl.nix)

b. Application Configurations
- Related configurations:
- Terminal Environment (tmux, zsh, vim/nvim)
- Window Management (x/hyprland, x/i3, x/waybar)
- Development Tools (vim/nvim, gitconfig)
- Container/Cloud (k8s directory structure)

c. Service Configurations
- Systemd services
- Kubernetes configurations
- Backup solutions

##### Additional Elements

- Version control integration points
- Backup system flow
- Cross-platform compatibility (WSL support)
- Configuration deployment paths

For this specific project, emphasize:
- The NixOS-based configuration management
- Multi-environment support
- The separation between system-level and user-level configurations
- Integration points between different tools and services
- The relationship between different configuration domains

Remember to include a clear indication of how configurations are deployed to different environments and how the backup system ensures configuration persistence.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Core["Core Configuration Management"]
        Flake["Flake Configuration"]:::core
        HomeConfig["Home Configurations"]:::core
        HostConfig["Host Configurations"]:::core
        BaseModule["Base Module System"]:::core
    end

    subgraph Environments["Environment-Specific Configurations"]
        PD0056["Development (PD0056)"]:::env
        PN0093["Production (PN0093)"]:::env
        WSL["WSL Configuration"]:::env
        GUI["GUI Configuration"]:::env
    end

    subgraph Apps["Application Configurations"]
        direction TB
        subgraph Terminal["Terminal Environment"]
            Tmux["Tmux"]:::terminal
            ZSH["ZSH"]:::terminal
            WezTerm["WezTerm"]:::terminal
        end

        subgraph WM["Window Management"]
            Hyprland["Hyprland"]:::wm
            I3["i3"]:::wm
            Waybar["Waybar"]:::wm
            X11["X11"]:::wm
        end

        subgraph DevTools["Development Tools"]
            Neovim["Neovim"]:::dev
            Git["Git Configuration"]:::dev
        end

        subgraph Container["Container/Cloud"]
            K8s["Kubernetes"]:::container
            K9s["K9s"]:::container
        end
    end

    subgraph Services["Service Configurations"]
        Systemd["Systemd Services"]:::service
        K8sManifests["K8s Manifests"]:::service
        Backup["Backup System"]:::service
        Logging["Logging"]:::service
    end

    subgraph IaC["Infrastructure as Code"]
        AKS["AKS Configuration"]:::iac
        Proxmox["Proxmox Configuration"]:::iac
    end

    Flake --> HomeConfig
    Flake --> HostConfig
    HomeConfig --> BaseModule
    BaseModule --> |Extends| PD0056
    BaseModule --> |Extends| PN0093
    BaseModule --> |Optional| WSL
    BaseModule --> |Optional| GUI

    GUI --> WM
    WSL --> Terminal
    HomeConfig --> DevTools
    HomeConfig --> Terminal
    HostConfig --> Services
    K8s --> K8sManifests
    K8s --> IaC
    K8sManifests --> Logging

    %% Click Events
    click Flake "https://github.com/tshm/dotfiles/blob/master/flake.nix"
    click HomeConfig "https://github.com/tshm/dotfiles/tree/master/homes/"
    click HostConfig "https://github.com/tshm/dotfiles/tree/master/hosts/"
    click BaseModule "https://github.com/tshm/dotfiles/blob/master/homes/modules/base.nix"
    click PD0056 "https://github.com/tshm/dotfiles/tree/master/homes/PD0056/"
    click PN0093 "https://github.com/tshm/dotfiles/tree/master/homes/PN0093/"
    click WSL "https://github.com/tshm/dotfiles/blob/master/homes/modules/wsl.nix"
    click GUI "https://github.com/tshm/dotfiles/blob/master/homes/modules/gui.nix"
    click Tmux "https://github.com/tshm/dotfiles/blob/master/tmux.conf"
    click ZSH "https://github.com/tshm/dotfiles/tree/master/zsh/zshrc"
    click Hyprland "https://github.com/tshm/dotfiles/tree/master/x/hyprland/"
    click I3 "https://github.com/tshm/dotfiles/tree/master/x/i3/"
    click Waybar "https://github.com/tshm/dotfiles/tree/master/x/waybar/"
    click Neovim "https://github.com/tshm/dotfiles/tree/master/vim/nvim/"
    click Git "https://github.com/tshm/dotfiles/tree/master/gitconfig"
    click K8s "https://github.com/tshm/dotfiles/tree/master/k8s/"
    click K9s "https://github.com/tshm/dotfiles/tree/master/k8s/k9s/"
    click Systemd "https://github.com/tshm/dotfiles/tree/master/systemd/"
    click K8sManifests "https://github.com/tshm/dotfiles/tree/master/k8s/manifest/"
    click Backup "https://github.com/tshm/dotfiles/tree/master/bkup/"
    click Logging "https://github.com/tshm/dotfiles/tree/master/k8s/manifest/base/logging/"
    click WezTerm "https://github.com/tshm/dotfiles/tree/master/wezterm/"
    click AKS "https://github.com/tshm/dotfiles/blob/master/k8s/aks/k8s.tf"
    click Proxmox "https://github.com/tshm/dotfiles/blob/master/k8s/proxmox_k8s.tf"
    click X11 "https://github.com/tshm/dotfiles/tree/master/x/Xresources"

    %% Styling
    classDef core fill:#2196F3,stroke:#1565C0,color:white
    classDef env fill:#9C27B0,stroke:#7B1FA2,color:white
    classDef terminal fill:#4CAF50,stroke:#388E3C,color:white
    classDef wm fill:#FF9800,stroke:#F57C00,color:white
    classDef dev fill:#00BCD4,stroke:#0097A7,color:white
    classDef container fill:#607D8B,stroke:#455A64,color:white
    classDef service fill:#FF5722,stroke:#E64A19,color:white
    classDef iac fill:#795548,stroke:#5D4037,color:white
```
