# craftaholic/dotfiles architecture

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

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

## Overview

##### Project type and purpose
- This is a dotfiles/configuration‐management framework (an open-source tool) whose goal is to centralize and declaratively manage all your workstation configuration files (hyprland, sway, nvim, Waybar, WezTerm, etc.) in one Git repository.
- It uses Taskfile as a task runner to bootstrap the environment and Devbox to install and pin required binaries.

##### File structure
- Top‐level:
- Taskfile.yml – orchestrates setup tasks (symlinks, installs)
- devbox.json – declarative list of required CLI tools (git, zsh, etc.)
- config/ – contains subdirectories for each application config (hypr, sway, nvim, swaylock, waybar, wezterm, libinput-gestures)
- Inside each config subfolder are the actual dotfiles and helper scripts (e.g., hypr/UserScripts, nvim lua modules).
- No “frontend” or “backend” here; it’s a local tool that integrates with the OS and installs software.

##### README for additional insights
- Setup flow: `task setup [--force]`
- Installs Devbox if missing
- Creates ~/.config directories and symlinks pointing to repo files
- Installs binaries via Devbox
- Emphasis on idempotency and declarative updates: updating the repo automatically updates real configs via symlinks.

##### Elements
- Clear labels: e.g., “Taskfile.yml”, “devbox.json”, “config/hypr”, etc.
- from Taskfile to Devbox (install binaries)
- from Taskfile to ~/.config (create symlinks)
- from applications back to ~/.config (read config)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Core Workflow
    A["Git Repository (Config Framework)"]:::repo
    B["Taskfile.yml"]:::repo
    C["devbox.json"]:::repo
    D["Devbox"]:::pkg
    E["OS (Linux/WSL/macOS)"]:::system

    %% Configuration Directories
    subgraph "Repo Config Directory"
        F["config/"]:::repo

        subgraph "Shell & Terminal Dotfiles"
            F1[".zshrc"]:::repo
            F2[".p10k.zsh"]:::repo
            F3[".tmux.conf"]:::repo
            F4[".vimrc"]:::repo
            F5[".aerospace.toml"]:::repo
        end

        subgraph "Hyprland Configuration"
            H1["*.conf"]:::repo
            H2["hypridle.conf"]:::repo
            H3["hyprlock.conf"]:::repo
            H4["hyprpaper.conf"]:::repo
            subgraph "configs/"
                H5["*.conf"]:::repo
            end
            subgraph "UserScripts/"
                H6["*.sh/.py"]:::repo
            end
            subgraph "scripts/"
                H7["*.sh"]:::repo
            end
            H8["themes/theme.conf"]:::repo
        end

        subgraph "Sway Configuration"
            S1["config"]:::repo
            S2["wallpapers/"]:::repo
        end

        subgraph "Swaylock Configuration"
            SL1["config"]:::repo
        end

        subgraph "Waybar Configuration"
            W1["config"]:::repo
            W2["modules/"]:::repo
            W3["style.css"]:::repo
        end

        subgraph "WezTerm Configuration"
            Z1["wezterm.lua"]:::repo
        end

        subgraph "Libinput-gestures Configuration"
            L1["gesture.conf"]:::repo
        end

        subgraph "Neovim Configuration"
            N1["init.lua"]:::repo
            N2["lazy-lock.json"]:::repo
            N3[".neoconf.json"]:::repo
            N4["stylua.toml"]:::repo
            subgraph "lua/tommy/"
                N5["*.lua"]:::repo
            end
            N6["README.md"]:::repo
            N7["LICENSE"]:::repo
        end
    end

    %% Symlink Target
    G["~/.config"]:::fs

    %% Runtime Applications
    subgraph "Applications"
        App1["Hyprland"]:::app
        App2["Sway"]:::app
        App3["Swaylock"]:::app
        App4["Waybar"]:::app
        App5["WezTerm"]:::app
        App6["libinput-gestures"]:::app
        App7["Neovim"]:::app
    end

    %% Control Flow
    A -->|"contains"| B
    A -->|"contains"| C
    A -->|"contains"| F

    B -->|"reads"| C
    B -->|"invokes"| D
    D -->|"runs on"| E
    B -->|"creates symlinks to"| G
    F -->|"symlink sources"| G

    %% Data Flow
    G -->|"provides configs to"| App1
    G -->|"provides configs to"| App2
    G -->|"provides configs to"| App3
    G -->|"provides configs to"| App4
    G -->|"provides configs to"| App5
    G -->|"provides configs to"| App6
    G -->|"provides configs to"| App7

    %% Click Events
    click A "https://github.com/craftaholic/dotfiles/tree/master/./"
    click B "https://github.com/craftaholic/dotfiles/blob/master/Taskfile.yml"
    click C "https://github.com/craftaholic/dotfiles/blob/master/devbox.json"
    click F "https://github.com/craftaholic/dotfiles/tree/master/config/"
    click F1 "https://github.com/craftaholic/dotfiles/blob/master/config/.zshrc"
    click F2 "https://github.com/craftaholic/dotfiles/blob/master/config/.p10k.zsh"
    click F3 "https://github.com/craftaholic/dotfiles/blob/master/config/.tmux.conf"
    click F4 "https://github.com/craftaholic/dotfiles/blob/master/config/.vimrc"
    click F5 "https://github.com/craftaholic/dotfiles/blob/master/config/.aerospace.toml"
    click H1 "https://github.com/craftaholic/dotfiles/blob/master/config/hypr/*.conf"
    click H2 "https://github.com/craftaholic/dotfiles/blob/master/config/hypr/hypridle.conf"
    click H3 "https://github.com/craftaholic/dotfiles/blob/master/config/hypr/hyprlock.conf"
    click H4 "https://github.com/craftaholic/dotfiles/blob/master/config/hypr/hyprpaper.conf"
    click H5 "https://github.com/craftaholic/dotfiles/blob/master/config/hypr/configs/*.conf"
    click H6 "https://github.com/craftaholic/dotfiles/blob/master/config/hypr/UserScripts/*.sh"
    click H6 "https://github.com/craftaholic/dotfiles/blob/master/config/hypr/UserScripts/*.py"
    click H7 "https://github.com/craftaholic/dotfiles/blob/master/config/hypr/scripts/*.sh"
    click H8 "https://github.com/craftaholic/dotfiles/blob/master/config/hypr/themes/theme.conf"
    click S1 "https://github.com/craftaholic/dotfiles/tree/master/config/sway/config"
    click S2 "https://github.com/craftaholic/dotfiles/tree/master/config/sway/wallpapers/"
    click SL1 "https://github.com/craftaholic/dotfiles/tree/master/config/swaylock/config"
    click W1 "https://github.com/craftaholic/dotfiles/tree/master/config/waybar/config"
    click W2 "https://github.com/craftaholic/dotfiles/tree/master/config/waybar/modules/"
    click W3 "https://github.com/craftaholic/dotfiles/blob/master/config/waybar/style.css"
    click Z1 "https://github.com/craftaholic/dotfiles/blob/master/config/wezterm/wezterm.lua"
    click L1 "https://github.com/craftaholic/dotfiles/blob/master/config/libinput-gestures/gesture.conf"
    click N1 "https://github.com/craftaholic/dotfiles/blob/master/config/nvim/init.lua"
    click N2 "https://github.com/craftaholic/dotfiles/blob/master/config/nvim/lazy-lock.json"
    click N3 "https://github.com/craftaholic/dotfiles/blob/master/config/nvim/.neoconf.json"
    click N4 "https://github.com/craftaholic/dotfiles/blob/master/config/nvim/stylua.toml"
    click N5 "https://github.com/craftaholic/dotfiles/tree/master/config/nvim/lua/tommy/"
    click N6 "https://github.com/craftaholic/dotfiles/blob/master/config/nvim/README.md"
    click N7 "https://github.com/craftaholic/dotfiles/tree/master/config/nvim/LICENSE"

    %% Styles
    classDef repo fill:#e0f7fa,stroke:#006064,color:#006064
    classDef pkg fill:#e8f5e9,stroke:#2e7d32,color:#2e7d32
    classDef system fill:#f3e5f5,stroke:#6a1b9a,color:#6a1b9a
    classDef fs fill:#fff3e0,stroke:#ef6c00,color:#ef6c00
    classDef app fill:#fff9c4,stroke:#f9a825,color:#f57f17
```
