# anscarlett/nixi architecture

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

- Interactive diagram: https://gitdiagram.com/anscarlett/nixi
- Repository: https://github.com/anscarlett/nixi

## Overview

##### Project type and purpose
- This is a CLI-driven NixOS installation tool, delivered as a Nix flake.
- It orchestrates: booting a NixOS live ISO, network setup, repo clone, interactive choices (disk, partition scheme, users, hostname), disk prep via Disko, NixOS install, YubiKey provisioning, then reboot.

##### File structure
- homes/   – predefined or user-customized user profiles
- hosts/   – per-machine host configurations
- modules/ – shared NixOS modules (partitioning presets, services, encryption, impermanence)
- flake.nix – the entrypoint flake that wires together homes, hosts, modules, and exposes CLI commands

##### Pull extra insights from README
- The workflow steps in the README define the user interaction points and external tools (Disko, YubiKey).

## Diagram (Mermaid)

```mermaid
flowchart TD
  %% Subgraphs
  subgraph "Live NixOS Environment"
    ISO["NixOS Live ISO"]:::live
    User["User"]:::live
    Network["Networking"]:::live
    ISO --> Network
    User --> Network
  end

  subgraph "Installer CLI (flake.nix + scripts)"
    CLI["flake.nix"]:::cli
  end

  subgraph "Config Repository"
    Homes["homes/"]:::repo
    Hosts["hosts/"]:::repo
    Modules["modules/"]:::repo
  end

  subgraph "External Tools"
    Git["Git"]:::tools
    Disko["Disko"]:::tools
    Nix["Nix"]:::tools
    YubiKey["YubiKey Provision"]:::tools
  end

  subgraph "Target System"
    Disk["Disk & Partitions"]:::target
    NixOSInstall["Installed NixOS"]:::target
    Reboot["Reboot into system"]:::target
  end

  %% Connections
  Network --> CLI
  User --> CLI
  CLI -->|"git clone"| Git
  Git --> Repo
  CLI --> Homes
  CLI --> Hosts
  CLI --> Modules
  CLI -->|"call Disko"| Disko
  Disko --> Disk
  CLI -->|"call Nix"| Nix
  Nix --> NixOSInstall
  CLI --> YubiKey
  NixOSInstall -->|"reboot"| Reboot

  %% Styles
  classDef live fill:#e0f7fa,stroke:#00838f,color:#006064;
  classDef cli fill:#bbdefb,stroke:#0d47a1,color:#0d47a1;
  classDef repo fill:#c8e6c9,stroke:#2e7d32,color:#1b5e20;
  classDef tools fill:#ffe0b2,stroke:#ef6c00,color:#e65100;
  classDef target fill:#eeeeee,stroke:#616161,color:#424242;
```
