# disguisedpigeon/nixos-dotfiles architecture

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

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

## Overview

##### Main Components
- Flake Definition: Represented by flake.nix and the accompanying files (flake.lock, overlays, and pkgs). This is the central piece that ties together your package sources, overlays, and configuration modules.
- Host/System Configurations: Found under the “host” directory. This includes machine-specific configurations (like configuration.nix, hardware-configuration.nix) and additional modules (in host/modules) that define graphical environments (awesomewm, hyprland, etc.), device settings, and general system setup.
- Home/User Configurations: Located in the “home” directory. This contains both machine-specific home configurations (e.g. DPigeon-MacOS/dpigeon and DPigeon-MacOS/test) managed via home-manager, as well as “common” home configurations that cover general user preferences (Neovim, zsh, rofi, etc.).
- Overlays and Packages: The “overlays” and “pkgs” directories offer customized package definitions and modifications, allowing the project to extend or override standard Nix packages.

##### Relationships and Interactions
- The Flake Definition is the entry point that gathers channels and references all the configurations. It “connects” to host and home configurations.
- Host configurations are applied to actual machines (DPigeon-MacOS, DPigeon-RasPI). They incorporate specific modules from “host/modules” which act just like Nix modules enabled for specific setups.
- Home configurations are deployed using home-manager. Note that “common” configurations serve as shared modules across multiple user setups. They are integrated with machine-specific home configurations (dpigeon vs. test) layers.
- Overlays are injected into the package system to customize behaviors or add new packages, which then feed into both host and home setups.

##### Architectural and Design Patterns
- Modular Configuration: The separation between host modules and common (user) configurations shows a clean modular structure for reusability and selective enablement by machine. This pattern is similar to plug-in architectures.
- Declarative Infrastructure: By using flakes and NixOS’s declarative model, every aspect of the system configuration is version-controlled and reproducible.
- Separation of Concerns: There is a clear division between system-wide configurations (host directory) and personal/home configurations, encouraging role separation (administrator vs. user settings) that fits the typical full-stack style of system administration.

##### Special Note on Host Modules and Common Configurations
- According to the additional instructions, host modules (in the “host/modules” folder) and common configurations (in “home/common”) serve the same purpose as general Nix modules that will be enabled by explicit configurations—for example, DPigeon-RasPI and DPigeon-MacOS for hosts, and dpigeon/test for home configurations.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Top-level Flake Definition and supporting components
    F["Flake Definition (flake.nix)"]:::flake
    O["Overlays"]:::overlays
    P["Pkgs"]:::pkgs
    R["Resources"]:::resources

    %% Host and Home Configuration groups
    subgraph "Host Configurations"
        H1["DPigeon-MacOS"]:::host
        H2["DPigeon-RasPI"]:::host
    end

    subgraph "Home Configurations"
        HM1["DPigeon (home-manager)"]:::home
        HM2["Test (home-manager)"]:::home
        COMMON["Common Configurations"]:::home
    end

    %% Detailed nodes for DPigeon-MacOS Host Configurations
    subgraph "DPigeon-MacOS Details"
        H1A["Configuration (configuration.nix)"]:::host
        H1B["Hardware Config (hardware-configuration.nix)"]:::host
        subgraph "Host Modules"
            M1["awesome.nix"]:::host
            M2["hyprland.nix"]:::host
            M3["dualboot.nix"]:::host
        end
    end

    %% Detailed node for DPigeon-RasPI Host Configurations
    subgraph "DPigeon-RasPI Details"
        H2A["Configuration (configuration.nix)"]:::host
    end

    %% Detailed nodes for Home Configurations Common Modules
    subgraph "Common Home Configurations"
        C1["alacritty.nix"]:::home
        C2["nvim.nix"]:::home
        C3["zsh.nix"]:::home
    end

    %% Detailed nodes for Home Manager specific configurations
    subgraph "DPigeon Home Details"
        HM1A["Home Config (home.nix)"]:::home
    end

    subgraph "Test Home Details"
        HM2A["Home Config (home.nix)"]:::home
    end

    %% Connecting top-level components
    O -->|"supplies"| F
    P -->|"supplies"| F
    R -->|"provides assets to"| F
    F -->|"feeds"| H1
    F -->|"feeds"| H2
    F -->|"feeds"| HM1
    F -->|"feeds"| HM2
    F -->|"feeds"| COMMON

    %% Connections within Host Configurations
    H1 --> H1A
    H1 --> H1B
    H1A -->|"uses"| M1
    H1A -->|"uses"| M2
    H1A -->|"uses"| M3

    H2 --> H2A

    %% Connections within Home Configurations
    HM1 --> HM1A
    HM2 --> HM2A
    COMMON -->|"shared config"| HM1
    COMMON -->|"shared config"| HM2
    COMMON --> C1
    COMMON --> C2
    COMMON --> C3

    %% Styling classes
    classDef flake fill:#f9e79f,stroke:#c0392b,stroke-width:2px;
    classDef host fill:#aed6f1,stroke:#1f618d,stroke-width:2px;
    classDef home fill:#d5f5e3,stroke:#27ae60,stroke-width:2px;
    classDef overlays fill:#f5cba7,stroke:#e67e22,stroke-width:2px;
    classDef pkgs fill:#fad7a0,stroke:#d35400,stroke-width:2px;
    classDef resources fill:#d7bde2,stroke:#8e44ad,stroke-width:2px;

    %% Click Events for Flake Definition and related components
    click F "https://github.com/disguisedpigeon/nixos-dotfiles/blob/main/flake.nix"
    click O "https://github.com/disguisedpigeon/nixos-dotfiles/tree/main/overlays/"
    click P "https://github.com/disguisedpigeon/nixos-dotfiles/blob/main/pkgs/default.nix"
    click R "https://github.com/disguisedpigeon/nixos-dotfiles/tree/main/resources/"

    %% Click Events for Host Configurations
    click H1A "https://github.com/disguisedpigeon/nixos-dotfiles/blob/main/host/DPigeon-MacOS/configuration.nix"
    click H1B "https://github.com/disguisedpigeon/nixos-dotfiles/blob/main/host/DPigeon-MacOS/hardware-configuration.nix"
    click M1 "https://github.com/disguisedpigeon/nixos-dotfiles/blob/main/host/modules/awesome.nix"
    click M2 "https://github.com/disguisedpigeon/nixos-dotfiles/blob/main/host/modules/hyprland.nix"
    click M3 "https://github.com/disguisedpigeon/nixos-dotfiles/blob/main/host/modules/dualboot.nix"
    click H2A "https://github.com/disguisedpigeon/nixos-dotfiles/blob/main/host/DPigeon-RasPI/configuration.nix"

    %% Click Events for Home Configurations
    click HM1A "https://github.com/disguisedpigeon/nixos-dotfiles/blob/main/home/DPigeon-MacOS/dpigeon/home.nix"
    click HM2A "https://github.com/disguisedpigeon/nixos-dotfiles/blob/main/home/DPigeon-MacOS/test/home.nix"
    click C1 "https://github.com/disguisedpigeon/nixos-dotfiles/blob/main/home/common/alacritty.nix"
    click C2 "https://github.com/disguisedpigeon/nixos-dotfiles/blob/main/home/common/nvim.nix"
    click C3 "https://github.com/disguisedpigeon/nixos-dotfiles/blob/main/home/common/zsh.nix"
```
