# stephencombs/dotfiles architecture

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

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

## Overview

##### Main Components
- Dotfiles Repository: This is the central source containing all the configuration files and templates.
- Configuration Groups: Organize configurations by tools or services. For this project, key groups include:
- shell (zsh) configurations and secrets (in dot_config/zsh)
- Neovim configurations and plugins (in dot_config/nvim)
- Terminal multiplexer (zellij) configs along with its plugins and themes (in dot_config/zellij)
- Aliases and other shell enhancements (located in dot_config/aliases)
- Utility scripts for setting up other tools (located in dot_config/scripts)
- Additional configurations like fzf and posh settings (e.g., dot_config/fzf, dot_config/posh)
- Template Files & Setup Scripts: Files like .chezmoi.toml.tmpl and shell scripts (e.g., run_once_before_install-packages.sh.tmpl) that help in applying and customizing the environment.

##### Relationships and Interactions
- Dependencies also exist among components: for instance, the zsh configuration may load source files (dot_config/zsh/dot_conf, dot_env) and utilize external tools like oh-my-posh.
- The alias files and scripts might be shared across tools, indicating a cross-component relationship.

##### Architectural Patterns and Design Principles
- Modularity: Configurations are maintained in separate directories for each tool, making the environment modular and easy to update.
- Reusability: Shell aliases, plugins, and scripts are reused across different tools.
- Declarative Setup: The use of chezmoi allows declarative management of the environment, ensuring that systems can be set up consistently across different OS (macOS and Debian-based Linux).
- Security: Use of encryption (files like encrypted_dot_secrets.age) to manage secure configurations.

##### Technologies and Tools
- Labels for external dependencies/tools such as Neovim, zsh, fzf, alacritty, zellij, oh-my-posh, and others.
- Chezmoi as the mechanism that installs and applies these configurations.
- Optionally, show age (the encryption tool) as a component for decrypting secure files prior to applying the configurations.

##### Final Detailed Assembly
- Connections where one configuration may be interdependent (for example, alias or script usage across multiple shells/tools).
- Adding notes that mention OS support (macOS and Linux) which could be annotated near the deployment block.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["Dotfiles Repository"]:::dotfiles
    B["chezmoi Deployment"]:::deployment
    A -->|"deploys"| B

    subgraph "Configurations"
        C["Neovim Config (plugins,keymaps,settings)"]:::config
        D["zsh Config (aliases,secrets,env)"]:::config
        E["Shell Aliases"]:::config
        F["Utility Scripts"]:::config
        G["fzf Config"]:::config
        H["oh-my-posh Settings"]:::config
        I["zellij Config (themes,layouts)"]:::config
    end

    B -->|"applies"| C
    B -->|"applies"| D
    B -->|"applies"| E
    B -->|"applies"| F
    B -->|"applies"| G
    B -->|"applies"| H
    B -->|"applies"| I

    subgraph "External Tools"
        J["Neovim"]:::external
        K["zsh"]:::external
        L["alacritty"]:::external
        M["oh-my-posh"]:::external
        N["age(decryption)"]:::external
    end

    C -->|"runsOn"| J
    D -->|"uses"| K
    D -->|"decryptsWith"| N
    H -->|"supports"| M

    O["Supported_OS:macOS_and_Linux"]:::note
    B -->|"appliesOn"| O

    click A "https://github.com/stephencombs/dotfiles/tree/main/Entire project file structure"
    click B "https://github.com/stephencombs/dotfiles/blob/main/.chezmoi.toml.tmpl"
    click C "https://github.com/stephencombs/dotfiles/tree/main/dot_config/nvim"
    click D "https://github.com/stephencombs/dotfiles/tree/main/dot_config/zsh"
    click E "https://github.com/stephencombs/dotfiles/tree/main/dot_config/aliases"
    click F "https://github.com/stephencombs/dotfiles/tree/main/dot_config/scripts"
    click G "https://github.com/stephencombs/dotfiles/tree/main/dot_config/fzf"
    click H "https://github.com/stephencombs/dotfiles/tree/main/dot_config/posh"
    click I "https://github.com/stephencombs/dotfiles/tree/main/dot_config/zellij"

    classDef dotfiles fill:#FFEEAD,stroke:#333,stroke-width:2px;
    classDef deployment fill:#CDEACC,stroke:#333,stroke-width:2px;
    classDef config fill:#CCE5FF,stroke:#333,stroke-width:2px;
    classDef external fill:#FFD1DC,stroke:#333,stroke-width:2px;
    classDef note fill:#E2E2E2,stroke:#333,stroke-dasharray:5,5,stroke-width:2px;
```
