# blxckmage/sefirah architecture

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

- Interactive diagram: https://gitdiagram.com/blxckmage/sefirah
- Repository: https://github.com/blxckmage/sefirah

## Overview

This repository is a NixOS workstation configuration, with a Python CLI package, Sefirah, providing several desktop-oriented utilities. The Sefirah workflow starts at command dispatch and branches into status, planetary-hour reporting, tarot draws and artwork, machine sigils, and Hyprlock configuration generation. The graph also preserves major configuration areas visible in the tree. Relationships for unsampled Nix modules are omitted; source-level links are based on the supplied excerpts and SOURCE INDEX.

Main entry points: [`pkgs/sefirah/sefirah/cli.py`](https://github.com/blxckmage/sefirah/blob/main/pkgs/sefirah/sefirah/cli.py) (Command dispatch), [`pkgs/sefirah/sefirah/tarot.py`](https://github.com/blxckmage/sefirah/blob/main/pkgs/sefirah/sefirah/tarot.py) (Tarot logic and images), [`pkgs/sefirah/sefirah/layout.py`](https://github.com/blxckmage/sefirah/blob/main/pkgs/sefirah/sefirah/layout.py) (Hyprlock layout), [`pkgs/sefirah/sefirah/sigil.py`](https://github.com/blxckmage/sefirah/blob/main/pkgs/sefirah/sefirah/sigil.py) (Machine sigil)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_system["System configuration"]
  node_nixos["NixOS modules"]
  node_host["Host configuration<br/>[tx1c7.nix]"]
  node_home["Home modules"]
end

subgraph group_desktop["Desktop environment"]
  node_niri["Niri desktop<br/>[niri.nix]"]
  node_waybar["Waybar setup<br/>[default.nix]"]
  node_nvim["Neovim setup"]
end

subgraph group_sefirah["Sefirah utilities"]
  node_cli["Command dispatch<br/>[cli.py]"]
  node_transmute["Lock config writer<br/>[transmute.py]"]
  node_status["System status<br/>[status.py]"]
  node_hour["Hour reporting<br/>[hour.py]"]
  node_draw["Daily tarot draw<br/>[draw.py]"]
  node_cards["Deck and artwork<br/>[cards.py]"]
  node_sigil["Machine sigil<br/>[sigil.py]"]
end

subgraph group_runtime["Sefirah internals"]
  node_layout["Hyprlock layout<br/>[layout.py]"]
  node_sky["Planetary and lunar time<br/>[sky.py]"]
  node_tarot["Tarot logic and images<br/>[tarot.py]"]
  node_common["Paths and helpers<br/>[common.py]"]
end

node_user(("Workstation user"))
node_commons["Wikimedia Commons"]
node_magick["ImageMagick"]
node_niri_service["Niri outputs"]
node_proc["Linux system data"]

node_user -->|"runs commands"| node_cli
node_cli -->|"dispatches"| node_transmute
node_cli -->|"dispatches"| node_status
node_cli -->|"dispatches"| node_hour
node_cli -->|"dispatches"| node_draw
node_cli -->|"dispatches"| node_cards
node_cli -->|"dispatches"| node_sigil
node_transmute -->|"generates config"| node_layout
node_layout -->|"renders sigil"| node_sigil
node_layout -->|"gets card image"| node_tarot
node_layout -->|"queries outputs"| node_niri_service
node_hour -->|"calculates phases"| node_sky
node_hour -->|"gets host seed"| node_sigil
node_hour -->|"draws daily card"| node_tarot
node_draw -->|"gets host seed"| node_sigil
node_draw -->|"draws or renders"| node_tarot
node_cards -->|"lists or fetches"| node_tarot
node_tarot -->|"fetches artwork"| node_commons
node_tarot -->|"converts artwork"| node_magick
node_sigil -->|"uses paths"| node_common
node_status -->|"reads system paths"| node_common
node_tarot -->|"uses cache paths"| node_common
node_layout -->|"uses state paths"| node_common
node_status -->|"reads metrics"| node_proc

click node_nixos "https://github.com/blxckmage/sefirah/tree/main/modules/nixos"
click node_host "https://github.com/blxckmage/sefirah/blob/main/modules/hosts/tx1c7.nix"
click node_home "https://github.com/blxckmage/sefirah/tree/main/modules/home"
click node_niri "https://github.com/blxckmage/sefirah/blob/main/modules/home/niri.nix"
click node_waybar "https://github.com/blxckmage/sefirah/blob/main/modules/home/files/waybar/default.nix"
click node_nvim "https://github.com/blxckmage/sefirah/tree/main/modules/nixcats/nvim"
click node_cli "https://github.com/blxckmage/sefirah/blob/main/pkgs/sefirah/sefirah/cli.py"
click node_transmute "https://github.com/blxckmage/sefirah/blob/main/pkgs/sefirah/sefirah/transmute.py"
click node_layout "https://github.com/blxckmage/sefirah/blob/main/pkgs/sefirah/sefirah/layout.py"
click node_status "https://github.com/blxckmage/sefirah/blob/main/pkgs/sefirah/sefirah/status.py"
click node_hour "https://github.com/blxckmage/sefirah/blob/main/pkgs/sefirah/sefirah/hour.py"
click node_sky "https://github.com/blxckmage/sefirah/blob/main/pkgs/sefirah/sefirah/sky.py"
click node_draw "https://github.com/blxckmage/sefirah/blob/main/pkgs/sefirah/sefirah/draw.py"
click node_cards "https://github.com/blxckmage/sefirah/blob/main/pkgs/sefirah/sefirah/cards.py"
click node_tarot "https://github.com/blxckmage/sefirah/blob/main/pkgs/sefirah/sefirah/tarot.py"
click node_sigil "https://github.com/blxckmage/sefirah/blob/main/pkgs/sefirah/sefirah/sigil.py"
click node_common "https://github.com/blxckmage/sefirah/blob/main/pkgs/sefirah/sefirah/common.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_nixos,node_host,node_home,node_user toneBlue
class node_niri,node_waybar,node_nvim toneAmber
class node_cli,node_transmute,node_status,node_hour,node_draw,node_cards,node_sigil toneMint
class node_layout,node_sky,node_tarot,node_common toneRose
class node_commons,node_magick,node_niri_service,node_proc toneIndigo
```

## Components

### System configuration

- [NixOS modules](https://github.com/blxckmage/sefirah/tree/main/modules/nixos): `modules/nixos`
- [Host configuration](https://github.com/blxckmage/sefirah/blob/main/modules/hosts/tx1c7.nix): `modules/hosts/tx1c7.nix`
- [Home modules](https://github.com/blxckmage/sefirah/tree/main/modules/home): `modules/home`

### Desktop environment

- [Niri desktop](https://github.com/blxckmage/sefirah/blob/main/modules/home/niri.nix): `modules/home/niri.nix`
- [Waybar setup](https://github.com/blxckmage/sefirah/blob/main/modules/home/files/waybar/default.nix): `modules/home/files/waybar/default.nix`
- [Neovim setup](https://github.com/blxckmage/sefirah/tree/main/modules/nixcats/nvim): `modules/nixcats/nvim`

### Sefirah utilities

- [Command dispatch](https://github.com/blxckmage/sefirah/blob/main/pkgs/sefirah/sefirah/cli.py): `pkgs/sefirah/sefirah/cli.py`
- [Lock config writer](https://github.com/blxckmage/sefirah/blob/main/pkgs/sefirah/sefirah/transmute.py): `pkgs/sefirah/sefirah/transmute.py`
- [System status](https://github.com/blxckmage/sefirah/blob/main/pkgs/sefirah/sefirah/status.py): `pkgs/sefirah/sefirah/status.py`
- [Hour reporting](https://github.com/blxckmage/sefirah/blob/main/pkgs/sefirah/sefirah/hour.py): `pkgs/sefirah/sefirah/hour.py`
- [Daily tarot draw](https://github.com/blxckmage/sefirah/blob/main/pkgs/sefirah/sefirah/draw.py): `pkgs/sefirah/sefirah/draw.py`
- [Deck and artwork](https://github.com/blxckmage/sefirah/blob/main/pkgs/sefirah/sefirah/cards.py): `pkgs/sefirah/sefirah/cards.py`
- [Machine sigil](https://github.com/blxckmage/sefirah/blob/main/pkgs/sefirah/sefirah/sigil.py): `pkgs/sefirah/sefirah/sigil.py`

### Sefirah internals

- [Hyprlock layout](https://github.com/blxckmage/sefirah/blob/main/pkgs/sefirah/sefirah/layout.py): `pkgs/sefirah/sefirah/layout.py`
- [Planetary and lunar time](https://github.com/blxckmage/sefirah/blob/main/pkgs/sefirah/sefirah/sky.py): `pkgs/sefirah/sefirah/sky.py`
- [Tarot logic and images](https://github.com/blxckmage/sefirah/blob/main/pkgs/sefirah/sefirah/tarot.py): `pkgs/sefirah/sefirah/tarot.py`
- [Paths and helpers](https://github.com/blxckmage/sefirah/blob/main/pkgs/sefirah/sefirah/common.py): `pkgs/sefirah/sefirah/common.py`

### Other components

- **Workstation user**
- **Wikimedia Commons**
- **ImageMagick**
- **Niri outputs**
- **Linux system data**

## Connections

- Workstation user → Command dispatch: runs commands
- Command dispatch → Lock config writer: dispatches (evidence: `pkgs/sefirah/sefirah/cli.py`)
- Command dispatch → System status: dispatches (evidence: `pkgs/sefirah/sefirah/cli.py`)
- Command dispatch → Hour reporting: dispatches (evidence: `pkgs/sefirah/sefirah/cli.py`)
- Command dispatch → Daily tarot draw: dispatches (evidence: `pkgs/sefirah/sefirah/cli.py`)
- Command dispatch → Deck and artwork: dispatches (evidence: `pkgs/sefirah/sefirah/cli.py`)
- Command dispatch → Machine sigil: dispatches (evidence: `pkgs/sefirah/sefirah/cli.py`)
- Lock config writer → Hyprlock layout: generates config (evidence: `pkgs/sefirah/sefirah/transmute.py`)
- Hyprlock layout → Machine sigil: renders sigil (evidence: `pkgs/sefirah/sefirah/layout.py`)
- Hyprlock layout → Tarot logic and images: gets card image (evidence: `pkgs/sefirah/sefirah/layout.py`)
- Hyprlock layout → Niri outputs: queries outputs (evidence: `pkgs/sefirah/sefirah/layout.py`)
- Hour reporting → Planetary and lunar time: calculates phases (evidence: `pkgs/sefirah/sefirah/hour.py`)
- Hour reporting → Machine sigil: gets host seed (evidence: `pkgs/sefirah/sefirah/hour.py`)
- Hour reporting → Tarot logic and images: draws daily card (evidence: `pkgs/sefirah/sefirah/hour.py`)
- Daily tarot draw → Machine sigil: gets host seed (evidence: `pkgs/sefirah/sefirah/draw.py`)
- Daily tarot draw → Tarot logic and images: draws or renders (evidence: `pkgs/sefirah/sefirah/draw.py`)
- Deck and artwork → Tarot logic and images: lists or fetches (evidence: `pkgs/sefirah/sefirah/cards.py`)
- Tarot logic and images → Wikimedia Commons: fetches artwork (evidence: `pkgs/sefirah/sefirah/tarot.py`)
- Tarot logic and images → ImageMagick: converts artwork (evidence: `pkgs/sefirah/sefirah/tarot.py`)
- Machine sigil → Paths and helpers: uses paths (evidence: `pkgs/sefirah/sefirah/sigil.py`)
- System status → Paths and helpers: reads system paths (evidence: `pkgs/sefirah/sefirah/status.py`)
- Tarot logic and images → Paths and helpers: uses cache paths (evidence: `pkgs/sefirah/sefirah/tarot.py`)
- Hyprlock layout → Paths and helpers: uses state paths (evidence: `pkgs/sefirah/sefirah/layout.py`)
- System status → Linux system data: reads metrics (evidence: `pkgs/sefirah/sefirah/status.py`)
