# injae/nix architecture

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

- Interactive diagram: https://gitdiagram.com/injae/nix
- Repository: https://github.com/injae/nix

## Overview

##### Main Components

a. System Layer
- NixOS-WSL Configuration
- Nix-Darwin Configuration
- System-specific configurations (dock, homebrew, etc.)

b. Home Manager Layer
- User configurations
- Program configurations
- Coding environment setups

c. Development Tools Layer
- Emacs configuration (extensive)
- Programming language environments
- Container and cloud tools

**┌─────────────────────────────────────────────┐**
- System Layer                   │
- ┤
- Home Manager                   │
- ┤
- Development Tools                 │
- ┘

##### Key Relationships

a. System Configuration Flow:
- How the flake.nix connects to different system configurations
- Relationship between system-specific configurations
- Connection between home manager and system configurations

b. Development Environment Setup:
- How programming language environments are configured
- Relationship between development tools
- Connection between templates and actual configurations

c. Emacs Configuration Structure:
- Modular structure of the Emacs configuration
- Relationship between different Emacs modules
- Connection between Emacs and language-specific configurations

##### Detailed Component Breakdown

a. Emacs Configuration:
**┌─────────────────────┐**
- Emacs Core      │
- ┤
- Language Modules   │
- Editor Features    │
- UI Components     │
- ┘

b. Development Environments:
**┌─────────────────────┐**
- Language Configs   │
- ┤
- Build Tools        │
- Package Managers   │
- ┘

## Diagram (Mermaid)

```mermaid
graph TB
    %% Main Layers
    subgraph SL["System Layer"]
        NixWSL["NixOS-WSL"]
        NixDarwin["Nix-Darwin"]
        DockConfig["Dock Configuration"]
        Homebrew["Homebrew"]
    end

    subgraph HM["Home Manager Layer"]
        UserConfig["User Configuration"]
        ProgramConfig["Program Configurations"]
        PackageManagement["Package Management"]
    end

    subgraph DT["Development Tools Layer"]
        subgraph IDE["IDE and Editors"]
            Emacs["Emacs Configuration"]
        end

        subgraph Cloud["Cloud Tools"]
            Container["Container Tools"]
            AWS["AWS Tools"]
            GCP["GCP Tools"]
        end

        subgraph Lang["Programming Languages"]
            Python["Python"]
            Rust["Rust"]
            Go["Go"]
            Java["Java"]
            JS["JavaScript"]
            CPP["C++"]
        end

        subgraph Term["Terminal Tools"]
            Alacritty["Alacritty"]
            TermConfig["Terminal Configuration"]
        end

        subgraph DevEnv["Development Environment"]
            Git["Git Configuration"]
            SSH["SSH Configuration"]
        end
    end

    subgraph Sec["Security"]
        SOPS["SOPS Integration"]
    end

    subgraph Temp["Templates"]
        BasicTemp["Basic Template"]
        BazelTemp["Bazel Template"]
        GoTemp["Go Template"]
        PythonTemp["Python Template"]
        RustTemp["Rust Template"]
    end

    %% Relationships
    NixWSL --> UserConfig
    NixDarwin --> UserConfig
    DockConfig --> NixDarwin
    Homebrew --> NixDarwin

    UserConfig --> ProgramConfig
    UserConfig --> PackageManagement

    ProgramConfig --> IDE
    ProgramConfig --> Cloud
    ProgramConfig --> Term
    ProgramConfig --> DevEnv

    PackageManagement --> Lang

    %% Click events
    click NixWSL "https://github.com/injae/nix/blob/main/systems/nixos-wsl/default.nix"
    click NixDarwin "https://github.com/injae/nix/blob/main/systems/darwin/default.nix"
    click DockConfig "https://github.com/injae/nix/blob/main/systems/darwin/dock/default.nix"
    click Homebrew "https://github.com/injae/nix/blob/main/systems/darwin/homebrew/default.nix"
    click UserConfig "https://github.com/injae/nix/blob/main/users/default.nix"
    click ProgramConfig "https://github.com/injae/nix/blob/main/home/programs/default.nix"
    click PackageManagement "https://github.com/injae/nix/blob/main/home/packages.nix"
    click Emacs "https://github.com/injae/nix/blob/main/home/programs/emacs/default.nix"
    click Container "https://github.com/injae/nix/blob/main/home/programs/container/default.nix"
    click AWS "https://github.com/injae/nix/blob/main/home/programs/aws/default.nix"
    click GCP "https://github.com/injae/nix/blob/main/home/programs/gcp/default.nix"
    click Python "https://github.com/injae/nix/blob/main/home/coding/python/default.nix"
    click Rust "https://github.com/injae/nix/blob/main/home/coding/rust/default.nix"
    click Go "https://github.com/injae/nix/blob/main/home/coding/golang/default.nix"
    click Java "https://github.com/injae/nix/blob/main/home/coding/java/default.nix"
    click JS "https://github.com/injae/nix/blob/main/home/coding/javascript/default.nix"
    click CPP "https://github.com/injae/nix/blob/main/home/coding/cpp/default.nix"
    click SOPS "https://github.com/injae/nix/blob/main/home/programs/sops/default.nix"
    click BasicTemp "https://github.com/injae/nix/blob/main/templates/basic/flake.nix"
    click BazelTemp "https://github.com/injae/nix/blob/main/templates/bazel/flake.nix"
    click GoTemp "https://github.com/injae/nix/blob/main/templates/go/flake.nix"
    click PythonTemp "https://github.com/injae/nix/blob/main/templates/python/flake.nix"
    click RustTemp "https://github.com/injae/nix/blob/main/templates/rust/flake.nix"
    click Alacritty "https://github.com/injae/nix/blob/main/home/programs/alacritty/default.nix"
    click TermConfig "https://github.com/injae/nix/blob/main/home/programs/terminal/default.nix"
    click Git "https://github.com/injae/nix/blob/main/home/programs/git/default.nix"
    click SSH "https://github.com/injae/nix/blob/main/home/programs/ssh/default.nix"

    %% Styling
    classDef system fill:#a8dadc
    classDef config fill:#457b9d
    classDef dev fill:#e63946
    classDef security fill:#f4a261
    classDef template fill:#2a9d8f

    class NixWSL,NixDarwin,DockConfig,Homebrew system
    class UserConfig,ProgramConfig,PackageManagement config
    class Emacs,Container,AWS,GCP,Python,Rust,Go,Java,JS,CPP,Alacritty,TermConfig,Git,SSH dev
    class SOPS security
    class BasicTemp,BazelTemp,GoTemp,PythonTemp,RustTemp template
```
