# n0ks/dotfiles architecture

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

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

## Overview

##### Main Components
- Installer & Setup: The install.sh at the root signals a central mechanism that deploys or symlinks the configuration files into the corresponding system locations. Also, the setups/ directory shows OS-specific scripts (e.g., arch-yay.sh, debian-apt.sh, and mac-setup.sh) for setting up different environments.
- Terminal & Visual Configurations: Components like alacritty, kitty, wezterm, and fonts represent configurations for different terminal emulators and font setups.
- Window Manager & Tiling System: The i3 directory and its nested scripts and configuration files represent the window manager’s settings along with its supporting utilities.
- Editor Environment: The nvim directory carries Neovim configuration files and plugin settings, indicating how the user customizes the text editor environment.
- Shell & CLI Tools: The zsh directory, along with tmux, rofi, and lazygit, provides customization for the shell, multiplexer, application launcher, and version control tools.
- Supporting Components & Modular Configs: Other directories like aerospace, private, and miscellaneous configuration files (.luarc.json, .gitmodules, etc.) help support broader aspects of the system styling and personalization.

##### Relationships and Interactions
- Each configuration component (i3, Neovim, zsh, etc.) functions independently but is integrated via the installation process. They share common support with scripts that might reference system-level dependencies (e.g., battery or cpu monitoring scripts in i3).
- The setups/ directory divides into OS-specific branches, so show that the Installer selects a specific configuration branch based on the operating system, leading to tailored behavior (arch, ubuntu, mac).

##### Architectural Patterns or Design Principles
- Modularity: Each configuration (terminal, window manager, editor, etc.) is separated into its own folder. This modular design allows isolated development, testing, and deployment of different parts.
- Automation & Reusability: The installation script(s) (install.sh, stow.sh) automate symlink creation or file copying, enforcing DRY principles by centralizing the deployment process.
- Customization & Extensibility: Multiple configuration files (like those in the nvim, i3, and zsh directories) suggest that the system is designed to be easily modified, extended, or replaced as needed.

##### Relevant Technologies, Frameworks, or Libraries
- Shell Scripting: Scripts for installation and various i3 utilities.
- Specific Application Configs: Neovim (with Lua-based configuration), zsh with its aliases and git configuration, and terminal emulators (kitty, alacritty, wezterm) with their respective configuration file formats.
- OS-specific package management tools: Brewfile for macOS, apt scripts for Debian-based systems, and yay scripts for Arch-based distributions.

- For example, rounded rectangles for configuration directories,
- Annotations for key files (like .gitmodules, Brewfile) which hint at external dependencies or integrations with package managers.
- Notes indicating that the installer chooses the relevant setup based on the operating system which then branches into individual configuration deployment.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Installer & Setup Group
    subgraph "Installer & Setup"
        InstallScript("install.sh"):::script
        StowScript("stow.sh"):::script
        OSSetups("OS-Specific Setups"):::os
    end

    %% OS-specific Setups Details
    OSSetups --> OSLinux("setups/linux"):::os
    OSSetups --> OSMac("setups/mac"):::os

    %% Terminal & Visual Configs
    subgraph "Terminal & Visual Configs"
        AL("alacritty"):::terminal
        KIT("kitty"):::terminal
        WEZ("wezterm"):::terminal
        FONTS("fonts"):::terminal
    end

    %% Window Manager Configs
    subgraph "Window Manager Configs"
        I3("i3"):::window
        I3S("i3 Scripts"):::window
    end

    %% Editor Configs
    subgraph "Editor Configs"
        NVIM("nvim"):::editor
        PLUGINS("Plugins"):::editor
        SNIPPETS("Snippets"):::editor
        LUA("Lua Config"):::editor
    end

    %% Shell & CLI Tools
    subgraph "Shell & CLI Tools"
        ZSH("zsh"):::shell
        TMUX("tmux"):::shell
        ROFI("rofi"):::shell
        LAZYGIT("lazygit"):::shell
    end

    %% Supporting & Modular Configs
    subgraph "Supporting & Modular Configs"
        AERO("aerospace"):::support
        PRIVATE("private"):::support
        GITMODULES(".gitmodules"):::support
        LUARC(".luarc.json"):::support
        BREW("Brewfile"):::support
    end

    %% Connections from Installer to Configurations
    InstallScript -->|"deploys"| AL
    InstallScript --> KIT
    InstallScript --> WEZ
    InstallScript --> FONTS
    InstallScript --> I3
    InstallScript --> NVIM
    InstallScript --> ZSH
    InstallScript --> TMUX
    InstallScript --> ROFI
    InstallScript --> LAZYGIT
    InstallScript --> AERO
    InstallScript --> PRIVATE
    InstallScript --> GITMODULES
    InstallScript --> LUARC
    InstallScript --> BREW

    %% Click Events for Installer & Setup
    click InstallScript "https://github.com/n0ks/dotfiles/blob/master/install.sh"
    click StowScript "https://github.com/n0ks/dotfiles/blob/master/stow.sh"
    click OSSetups "https://github.com/n0ks/dotfiles/tree/master/setups/"
    click OSLinux "https://github.com/n0ks/dotfiles/tree/master/setups/linux"
    click OSMac "https://github.com/n0ks/dotfiles/tree/master/setups/mac"

    %% Click Events for Terminal & Visual Configs
    click AL "https://github.com/n0ks/dotfiles/tree/master/.config/alacritty"
    click KIT "https://github.com/n0ks/dotfiles/tree/master/.config/kitty"
    click WEZ "https://github.com/n0ks/dotfiles/blob/master/.config/wezterm.lua"
    click FONTS "https://github.com/n0ks/dotfiles/tree/master/.local/share/fonts"

    %% Click Events for Window Manager
    click I3 "https://github.com/n0ks/dotfiles/tree/master/.config/i3"

    %% Click Events for Editor Configs
    click NVIM "https://github.com/n0ks/dotfiles/tree/master/.config/nvim"

    %% Click Events for Shell & CLI Tools
    click ZSH "https://github.com/n0ks/dotfiles/tree/master/zsh/"
    click TMUX "https://github.com/n0ks/dotfiles/tree/master/tmux/"
    click ROFI "https://github.com/n0ks/dotfiles/tree/master/rofi/"
    click LAZYGIT "https://github.com/n0ks/dotfiles/tree/master/.config/lazygit"

    %% Click Events for Supporting & Modular Configs
    click AERO "https://github.com/n0ks/dotfiles/tree/master/.config/aerospace"
    click PRIVATE "https://github.com/n0ks/dotfiles/tree/master/private/"
    click GITMODULES "https://github.com/n0ks/dotfiles/blob/master/.gitmodules"
    click LUARC "https://github.com/n0ks/dotfiles/blob/master/.luarc.json"
    click BREW "https://github.com/n0ks/dotfiles/tree/master/Brewfile"

    %% Styles
    classDef script fill:#add8e6,stroke:#000,stroke-width:2px;
    classDef os fill:#ffff99,stroke:#000,stroke-width:2px;
    classDef terminal fill:#90ee90,stroke:#000,stroke-width:2px;
    classDef window fill:#ffa500,stroke:#000,stroke-width:2px;
    classDef editor fill:#dda0dd,stroke:#000,stroke-width:2px;
    classDef shell fill:#ffb6c1,stroke:#000,stroke-width:2px;
    classDef support fill:#d3d3d3,stroke:#000,stroke-width:2px;
```
