# myleslandais/nix architecture

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

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

## Overview

This repository is a NixOS configuration for personal workstations and ARM64 OCI hosts, with Forgejo hosting and several 3DS utilities. The main operator workflow is selecting a host configuration, composing reusable Nix modules, and applying it with a NixOS rebuild; the README documents the host, Hyprland, and Forgejo relationships. The scripts provide separate extraction, save-backup, and emulator-control workflows. Source evidence is sampled and incomplete, so links among unsampled modules are omitted rather than inferred.

Main entry points: [`modules/hosts`](https://github.com/myleslandais/nix/tree/dev/modules/hosts) (Host configurations), [`infra/forgejo`](https://github.com/myleslandais/nix/tree/dev/infra/forgejo) (Forgejo deployment), [`infra/forgejo/compose.yaml`](https://github.com/myleslandais/nix/blob/dev/infra/forgejo/compose.yaml) (Forgejo service), [`modules/hosts/stage-db`](https://github.com/myleslandais/nix/tree/dev/modules/hosts/stage-db) (Stage DB host)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_hosts["Host systems"]
  node_hostconfigs["Host configurations"]
  node_stage_db["Stage DB host"]
  node_shared_modules["Shared Nix modules"]
end

subgraph group_desktop["Desktop features"]
  node_hyprland["Hyprland desktop"]
  node_bars["Desktop bars"]
  node_shelltools["Shell tools"]
end

subgraph group_hosting["Git hosting"]
  node_forgejo_deploy["Forgejo deployment"]
  node_cloudflare["Cloudflare Tunnel"]
  node_forgejo_service["Forgejo service<br/>[compose.yaml]"]
  node_forgejo_db[("Forgejo database<br/>[main.tf]")]
end

subgraph group_tools["3DS utilities"]
  node_fe_index["Echoes extract/index<br/>[fe_echoes_index.py]"]
  node_save_sync["Save snapshot/sync"]
  node_save_storage[("Snapshot storage")]
  node_citra_bridge["Emulator bridge"]
end

node_operator(("System operator"))
node_rebuild["NixOS rebuild"]
node_git_user(("Git users"))
node_game_owner(("3DS data owner"))
node_ctrtool["ctrtool"]
node_azahar["Azahar emulator"]

node_operator -->|"applies changes"| node_rebuild
node_rebuild -->|"selects host"| node_hostconfigs
node_hostconfigs -.->|"uses modules"| node_shared_modules
node_hostconfigs -->|"configures desktop"| node_hyprland
node_hostconfigs -->|"hosts Forgejo"| node_stage_db
node_hyprland -.->|"integrates bar"| node_bars
node_operator -->|"deploys hosting"| node_forgejo_deploy
node_forgejo_deploy -.->|"configures service"| node_forgejo_service
node_forgejo_deploy -.->|"provisions database"| node_forgejo_db
node_stage_db -->|"serves through"| node_cloudflare
node_cloudflare -->|"routes traffic"| node_forgejo_service
node_git_user -->|"uses Git hosting"| node_forgejo_service
node_game_owner -->|"extracts or indexes"| node_fe_index
node_fe_index -->|"extracts dump"| node_ctrtool
node_game_owner -->|"snapshots saves"| node_save_sync
node_save_sync -->|"writes verified snapshots"| node_save_storage
node_game_owner -->|"controls session"| node_citra_bridge
node_citra_bridge -->|"launches emulator"| node_azahar

click node_hostconfigs "https://github.com/myleslandais/nix/tree/dev/modules/hosts"
click node_stage_db "https://github.com/myleslandais/nix/tree/dev/modules/hosts/stage-db"
click node_shared_modules "https://github.com/myleslandais/nix/tree/dev/modules"
click node_hyprland "https://github.com/myleslandais/nix/tree/dev/modules/_features/desktops/hyprland"
click node_bars "https://github.com/myleslandais/nix/tree/dev/modules/_features/bars"
click node_shelltools "https://github.com/myleslandais/nix/tree/dev/modules/_features/shelltools"
click node_forgejo_deploy "https://github.com/myleslandais/nix/tree/dev/infra/forgejo"
click node_forgejo_service "https://github.com/myleslandais/nix/blob/dev/infra/forgejo/compose.yaml"
click node_forgejo_db "https://github.com/myleslandais/nix/blob/dev/infra/forgejo/main.tf"
click node_fe_index "https://github.com/myleslandais/nix/blob/dev/scripts/fe_echoes_index.py"
click node_save_sync "https://github.com/myleslandais/nix/blob/dev/scripts/three_ds_save_sync.py"
click node_citra_bridge "https://github.com/myleslandais/nix/blob/dev/scripts/citra_agent_bridge.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_hostconfigs,node_stage_db,node_shared_modules,node_git_user toneBlue
class node_hyprland,node_bars,node_shelltools toneAmber
class node_forgejo_deploy,node_cloudflare,node_forgejo_service,node_forgejo_db toneMint
class node_fe_index,node_save_sync,node_save_storage,node_citra_bridge toneRose
class node_operator,node_rebuild,node_game_owner,node_ctrtool,node_azahar toneIndigo
```

## Components

### Host systems

- [Host configurations](https://github.com/myleslandais/nix/tree/dev/modules/hosts): `modules/hosts`
- [Stage DB host](https://github.com/myleslandais/nix/tree/dev/modules/hosts/stage-db): `modules/hosts/stage-db`
- [Shared Nix modules](https://github.com/myleslandais/nix/tree/dev/modules): `modules`

### Desktop features

- [Hyprland desktop](https://github.com/myleslandais/nix/tree/dev/modules/_features/desktops/hyprland): `modules/_features/desktops/hyprland`
- [Desktop bars](https://github.com/myleslandais/nix/tree/dev/modules/_features/bars): `modules/_features/bars`
- [Shell tools](https://github.com/myleslandais/nix/tree/dev/modules/_features/shelltools): `modules/_features/shelltools`

### Git hosting

- [Forgejo deployment](https://github.com/myleslandais/nix/tree/dev/infra/forgejo): `infra/forgejo`
- **Cloudflare Tunnel**
- [Forgejo service](https://github.com/myleslandais/nix/blob/dev/infra/forgejo/compose.yaml): `infra/forgejo/compose.yaml`
- [Forgejo database](https://github.com/myleslandais/nix/blob/dev/infra/forgejo/main.tf): `infra/forgejo/main.tf`

### 3DS utilities

- [Echoes extract/index](https://github.com/myleslandais/nix/blob/dev/scripts/fe_echoes_index.py): `scripts/fe_echoes_index.py`
- [Save snapshot/sync](https://github.com/myleslandais/nix/blob/dev/scripts/three_ds_save_sync.py): `scripts/three_ds_save_sync.py`
- **Snapshot storage**
- [Emulator bridge](https://github.com/myleslandais/nix/blob/dev/scripts/citra_agent_bridge.py): `scripts/citra_agent_bridge.py`

### Other components

- **System operator**
- **NixOS rebuild**
- **Git users**
- **3DS data owner**
- **ctrtool**
- **Azahar emulator**

## Connections

- System operator → NixOS rebuild: applies changes (evidence: `README.md`)
- NixOS rebuild → Host configurations: selects host (evidence: `README.md`)
- Host configurations → Shared Nix modules: uses modules
- Host configurations → Hyprland desktop: configures desktop (evidence: `README.md`)
- Host configurations → Stage DB host: hosts Forgejo (evidence: `README.md`)
- Hyprland desktop → Desktop bars: integrates bar
- System operator → Forgejo deployment: deploys hosting (evidence: `README.md`)
- Forgejo deployment → Forgejo service: configures service
- Forgejo deployment → Forgejo database: provisions database
- Stage DB host → Cloudflare Tunnel: serves through (evidence: `README.md`)
- Cloudflare Tunnel → Forgejo service: routes traffic (evidence: `README.md`)
- Git users → Forgejo service: uses Git hosting (evidence: `README.md`)
- 3DS data owner → Echoes extract/index: extracts or indexes (evidence: `scripts/fe_echoes_index.py`)
- Echoes extract/index → ctrtool: extracts dump (evidence: `scripts/fe_echoes_index.py`)
- 3DS data owner → Save snapshot/sync: snapshots saves (evidence: `scripts/three_ds_save_sync.py`)
- Save snapshot/sync → Snapshot storage: writes verified snapshots (evidence: `scripts/three_ds_save_sync.py`)
- 3DS data owner → Emulator bridge: controls session (evidence: `scripts/citra_agent_bridge.py`)
- Emulator bridge → Azahar emulator: launches emulator (evidence: `scripts/citra_agent_bridge.py`)
