# kra3/nix-configs architecture

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

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

## Overview

This repository declaratively configures NixOS and macOS machines. The main workflow is a host-specific configuration selecting shared system services, container stacks, and Home Manager settings, with flake outputs representing each host. Other documented branches include secrets management and reusable helper libraries. The README and tree support these architectural boundaries; implementation details and links between individual services are not established by the sampled source, so those are left unspecified.

Main entry points: [`hosts/sutala`](https://github.com/kra3/nix-configs/tree/main/hosts/sutala) (sutala server), [`modules/home`](https://github.com/kra3/nix-configs/tree/main/modules/home) (Home Manager modules), [`flake.nix`](https://github.com/kra3/nix-configs/blob/main/flake.nix) (Flake outputs), [`hosts/mac-work`](https://github.com/kra3/nix-configs/tree/main/hosts/mac-work) (mac-work laptop)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_machine["Machine configurations"]
  node_host_catalog["Host catalog<br/>[hosts.nix]"]
  node_flake["Flake outputs<br/>[flake.nix]"]
  node_sutala["sutala server"]
  node_macwork["mac-work laptop"]
end

subgraph group_runtime["System runtime"]
  node_system_services["System services"]
  node_container_stacks["Container stacks"]
  node_home_auto["Home automation"]
  node_media["Media services"]
  node_monitoring["Monitoring"]
end

subgraph group_user["User environment"]
  node_home_manager["Home Manager modules"]
  node_shell["Shell setup"]
  node_host_users["User modules"]
end

subgraph group_shared["Shared support"]
  node_secrets[("Secrets")]
  node_helpers["Shared helpers"]
end

node_admin(("System administrator"))

node_admin -->|"defines hosts"| node_host_catalog
node_host_catalog -->|"feeds outputs"| node_flake
node_sutala -->|"configures host"| node_flake
node_macwork -->|"configures host"| node_flake
node_sutala -->|"selects modules"| node_system_services
node_sutala -->|"selects stacks"| node_container_stacks
node_sutala -.->|"selects profile"| node_home_auto
node_sutala -.->|"selects profile"| node_media
node_sutala -.->|"selects profile"| node_monitoring
node_sutala -->|"imports users"| node_host_users
node_macwork -->|"selects modules"| node_home_manager
node_sutala -->|"selects modules"| node_home_manager
node_home_manager -->|"configures shell"| node_shell
node_sutala -->|"uses secrets"| node_secrets
node_system_services -.->|"uses helpers"| node_helpers

click node_host_catalog "https://github.com/kra3/nix-configs/blob/main/flake/hosts.nix"
click node_flake "https://github.com/kra3/nix-configs/blob/main/flake.nix"
click node_sutala "https://github.com/kra3/nix-configs/tree/main/hosts/sutala"
click node_macwork "https://github.com/kra3/nix-configs/tree/main/hosts/mac-work"
click node_system_services "https://github.com/kra3/nix-configs/tree/main/modules/services"
click node_container_stacks "https://github.com/kra3/nix-configs/tree/main/modules/containers"
click node_home_auto "https://github.com/kra3/nix-configs/tree/main/modules/profiles/home-automation"
click node_media "https://github.com/kra3/nix-configs/tree/main/modules/profiles/media"
click node_monitoring "https://github.com/kra3/nix-configs/tree/main/modules/profiles/observability"
click node_home_manager "https://github.com/kra3/nix-configs/tree/main/modules/home"
click node_shell "https://github.com/kra3/nix-configs/tree/main/modules/home/shell"
click node_host_users "https://github.com/kra3/nix-configs/tree/main/modules/users"
click node_secrets "https://github.com/kra3/nix-configs/tree/main/secrets"
click node_helpers "https://github.com/kra3/nix-configs/tree/main/modules/lib"

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_host_catalog,node_flake,node_sutala,node_macwork toneBlue
class node_system_services,node_container_stacks,node_home_auto,node_media,node_monitoring toneAmber
class node_home_manager,node_shell,node_host_users toneMint
class node_secrets,node_helpers toneRose
class node_admin toneIndigo
```

## Components

### Machine configurations

- [Host catalog](https://github.com/kra3/nix-configs/blob/main/flake/hosts.nix): `flake/hosts.nix`
- [Flake outputs](https://github.com/kra3/nix-configs/blob/main/flake.nix): `flake.nix`
- [sutala server](https://github.com/kra3/nix-configs/tree/main/hosts/sutala): `hosts/sutala`
- [mac-work laptop](https://github.com/kra3/nix-configs/tree/main/hosts/mac-work): `hosts/mac-work`

### System runtime

- [System services](https://github.com/kra3/nix-configs/tree/main/modules/services): `modules/services`
- [Container stacks](https://github.com/kra3/nix-configs/tree/main/modules/containers): `modules/containers`
- [Home automation](https://github.com/kra3/nix-configs/tree/main/modules/profiles/home-automation): `modules/profiles/home-automation`
- [Media services](https://github.com/kra3/nix-configs/tree/main/modules/profiles/media): `modules/profiles/media`
- [Monitoring](https://github.com/kra3/nix-configs/tree/main/modules/profiles/observability): `modules/profiles/observability`

### User environment

- [Home Manager modules](https://github.com/kra3/nix-configs/tree/main/modules/home): `modules/home`
- [Shell setup](https://github.com/kra3/nix-configs/tree/main/modules/home/shell): `modules/home/shell`
- [User modules](https://github.com/kra3/nix-configs/tree/main/modules/users): `modules/users`

### Shared support

- [Secrets](https://github.com/kra3/nix-configs/tree/main/secrets): `secrets`
- [Shared helpers](https://github.com/kra3/nix-configs/tree/main/modules/lib): `modules/lib`

### Other components

- **System administrator**

## Connections

- System administrator → Host catalog: defines hosts (evidence: `README.md`)
- Host catalog → Flake outputs: feeds outputs (evidence: `README.md`)
- sutala server → Flake outputs: configures host (evidence: `README.md`)
- mac-work laptop → Flake outputs: configures host (evidence: `README.md`)
- sutala server → System services: selects modules (evidence: `README.md`)
- sutala server → Container stacks: selects stacks (evidence: `README.md`)
- sutala server → Home automation: selects profile
- sutala server → Media services: selects profile
- sutala server → Monitoring: selects profile
- sutala server → User modules: imports users (evidence: `README.md`)
- mac-work laptop → Home Manager modules: selects modules (evidence: `README.md`)
- sutala server → Home Manager modules: selects modules (evidence: `README.md`)
- Home Manager modules → Shell setup: configures shell (evidence: `README.md`)
- sutala server → Secrets: uses secrets (evidence: `README.md`)
- System services → Shared helpers: uses helpers
