# theutz/dotfiles architecture

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

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

## Overview

##### Core Components
- Create distinct sections for the following major subsystems:
a. Shell Environment (Zsh/Prezto)
b. Development Tools
c. GUI Applications
d. System Configuration
e. Security/Encryption

##### Key Relationships and Flows

a. Configuration Management Flow:
- User Input -> Chezmoi Manager -> Template Processing -> File Deployment

b. Security Layer:
- Encrypted Files (.age) -> Decryption -> Protected Configuration

##### Component Details

a. Shell Environment:
- Prezto Modules
- Custom Functions
- Environment Variables
- Aliases

b. Development Tools:
- Neovim Configuration
- Git Configuration
- Terminal Emulators (Alacritty, Wezterm, etc.)
- Development Utilities (tmux, fzf, etc.)

c. GUI Applications:
- Hammerspoon
- Sketchybar
- Qutebrowser
- iTerm2

d. System Configuration:
- Homebrew Packages
- macOS Defaults
- XDG Base Directory
- Window Management

e. Security:
- SSH Keys
- GPG Configuration
- Age Encryption
- Private Tokens

##### Specific Implementation Details

Key elements:
- Template Processing (.tmpl files)
- ↓
- Configuration Data (.chezmoidata)
- ↓
- Script Execution (.chezmoiscripts)
- ↓
- File Management

##### Integration Points
- Data flow between different subsystems
- Dependencies between components

##### Notes
Annotations for:
- Platform-specific components (macOS)
- Security-sensitive areas
- Custom script locations
- Configuration hierarchy

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Legend
        L1[Core Components]:::core
        L2[Security Components]:::security
        L3[Development Tools]:::dev
        L4[GUI Applications]:::gui
        L5[System Configuration]:::system
        L6[".tmpl - Template Files"]:::template
        L7[".age - Encrypted Files"]:::encrypted
    end

    subgraph Core["Core Configuration Management"]
        CM[Chezmoi Manager]:::core
        click CM "https://github.com/theutz/dotfiles/blob/main/home/.chezmoi.toml.tmpl"
        CD["Configuration Data"]:::core
        click CD "https://github.com/theutz/dotfiles/tree/main/home/.chezmoidata/"
        CS["Chezmoi Scripts"]:::core
        click CS "https://github.com/theutz/dotfiles/tree/main/home/.chezmoiscripts/"
        CT["Chezmoi Templates"]:::core
        click CT "https://github.com/theutz/dotfiles/tree/main/home/.chezmoitemplates/"
    end

    subgraph Shell["Shell Environment"]
        PZ["Prezto Modules"]:::shell
        click PZ "https://github.com/theutz/dotfiles/tree/main/home/dot_config/prezto/"
        ZRC["Zsh Runtime Config"]:::shell
        click ZRC "https://github.com/theutz/dotfiles/blob/main/home/.dot_zshrc.tmpl"
        ZENV["Zsh Environment"]:::shell
        click ZENV "https://github.com/theutz/dotfiles/blob/main/home/.dot_zshenv"
        ZPROF["Zsh Profile"]:::shell
        click ZPROF "https://github.com/theutz/dotfiles/blob/main/home/.dot_zprofile.tmpl"
    end

    subgraph DevTools["Development Tools"]
        NV["Neovim"]:::dev
        click NV "https://github.com/theutz/dotfiles/tree/main/home/dot_config/exact_nvim/"
        GIT["Git Config"]:::dev
        click GIT "https://github.com/theutz/dotfiles/tree/main/home/dot_config/git/"
        TMUX["Tmux"]:::dev
        click TMUX "https://github.com/theutz/dotfiles/tree/main/home/dot_config/exact_tmux/"
        WEZ["Wezterm"]:::dev
        click WEZ "https://github.com/theutz/dotfiles/tree/main/home/dot_config/exact_wezterm/"
        ALA["Alacritty"]:::dev
        click ALA "https://github.com/theutz/dotfiles/tree/main/home/dot_config/alacritty/"
    end

    subgraph GUI["GUI Applications"]
        HS["Hammerspoon"]:::gui
        click HS "https://github.com/theutz/dotfiles/tree/main/home/exact_dot_hammerspoon/"
        SB["Sketchybar"]:::gui
        click SB "https://github.com/theutz/dotfiles/tree/main/home/dot_config/exact_sketchybar/"
        QB["Qutebrowser"]:::gui
        click QB "https://github.com/theutz/dotfiles/tree/main/home/exact_private_dot_qutebrowser/"
        IT["iTerm2"]:::gui
        click IT "https://github.com/theutz/dotfiles/tree/main/home/dot_config/iterm2/"
    end

    subgraph SysConfig["System Configuration"]
        BR["Homebrew Packages"]:::system
        click BR "https://github.com/theutz/dotfiles/blob/main/home/dot_Brewfile.tmpl"
        MD["macOS Defaults"]:::system
        click MD "https://github.com/theutz/dotfiles/blob/main/home/.chezmoiscripts/run_onchange_after_160-set-mac-defaults.zsh"
        PKG["Package Installation"]:::system
        click PKG "https://github.com/theutz/dotfiles/blob/main/home/.chezmoiscripts/run_onchange_after_30-install-packages.zsh.tmpl"
    end

    subgraph Security["Security Layer"]
        GPG["GPG Config"]:::security
        click GPG "https://github.com/theutz/dotfiles/tree/main/home/private_dot_gnupg/"
        SSH["SSH Keys"]:::security
        click SSH "https://github.com/theutz/dotfiles/tree/main/home/private_dot_ssh/"
        SEC["Encrypted Secrets"]:::security
        click SEC "https://github.com/theutz/dotfiles/blob/main/home/.encrypted_dot_zsecrets.age"
        AI["AI Commits Config"]:::security
        click AI "https://github.com/theutz/dotfiles/blob/main/home/.encrypted_dot_aicommits.age"
        KEY["Encryption Key"]:::security
        click KEY "https://github.com/theutz/dotfiles/blob/main/home/key.txt.age"
    end

    CM --> CD
    CM --> CS
    CM --> CT
    
    CM --> Shell
    CM --> DevTools
    CM --> GUI
    CM --> SysConfig
    CM --> Security

    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef security fill:#27ae60,stroke:#219a52,color:white
    classDef dev fill:#e67e22,stroke:#d35400,color:white
    classDef gui fill:#9b59b6,stroke:#8e44ad,color:white
    classDef system fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef shell fill:#f1c40f,stroke:#f39c12,color:white
    classDef template fill:#ecf0f1,stroke:#bdc3c7
    classDef encrypted fill:#c0392b,stroke:#a93226,color:white
```
