No description
- Rust 99.3%
- Nix 0.7%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| crates | ||
| infra-client | ||
| .gitignore | ||
| .woodpecker.yml | ||
| Cargo.toml | ||
| flake.lock | ||
| flake.nix | ||
| infra-map.toml | ||
| README.md | ||
| REFACTOR_PLAN.md | ||
infra-map
Interactive, real-time infrastructure map for the cyperpunk.de homelab.
Overview
infra-map is a Rust TUI application that discovers, monitors, and visualizes the entire homelab infrastructure defined in the cyper-nix Nix flake. It provides live health checks, service details, and an interactive explorable map of all machines and services.
Features
- Static Discovery: Parses
cyper-nix/flake.nixto extract machine definitions, roles, and service configurations - Live Health Monitoring: Real-time API health checks for all services (Matrix, Forgejo, SearXNG, Vaultwarden, Mastodon, Kanidm, etc.)
- Interactive TUI: Keyboard-driven dashboard with tabs for Overview, Machines, Services, Matrix, Forgejo, SearXNG, Identity, Fediverse, Secrets, and Logs
- Service Details: Deep-dive into each service with configuration, endpoints, and live metrics
- Export: Export topology as JSON or GraphViz DOT
- Woodpecker CI: Automated fmt, clippy, test, build, audit, and release pipelines
Architecture
cyperpunk.de homelab (5 machines)
├── cyper-desktop (NixOS, x86_64, Desktop)
├── cyper-mac (macOS, x86_64, Laptop)
├── cyper-controller (NixOS, x86_64, Controller - runs all services)
├── cyper-node-1 (NixOS, x86_64, Server node)
└── cyper-node-2 (NixOS, x86_64, Server node)
Public Services:
- Matrix (Synapse 1.158.0) -
cyperpunk.de,cinny.cyperpunk.de - Forgejo 16.0.2 -
git.cyperpunk.de(SSH: 12222) - SearXNG 2026.8.4 -
search.cyperpunk.de/10.10.0.2:11080 - Vaultwarden -
vault.cyperpunk.de - Mastodon (Cypersocial) -
mastodon.cyperpunk.de - Kanidm SSO -
auth.cyperpunk.de
Internal Services (VPN/LAN):
- Prometheus, Grafana, AdGuard, UniFi, Woodpecker, JupyterHub, Coturn, LiveKit, FileBrowser
Installation
From Source
git clone https://git.cyperpunk.de/DerGrumpf/infrastructure.git
cd infrastructure
cargo install --path .
Nix Flake (for cyper-nix integration)
# In your flake.nix
inputs.infra-map.url = "git+https://git.cyperpunk.de/DerGrumpf/infrastructure.git";
# Then add infra-map.packages.${system}.infra-map to your system packages
Usage
# Run interactive TUI (requires cyper-nix at ../cyper-nix)
infra-map
# Custom flake path
infra-map --flake-path /path/to/cyper-nix
# Run once and output JSON (for scripting)
infra-map --once
# Debug mode
infra-map --debug
# Disable TLS verification (for self-signed certs)
infra-map --insecure
Environment Variables
export INFRA_MAP_GITEA_TOKEN="your_forgejo_token"
export INFRA_MAP_MATRIX_TOKEN="your_matrix_access_token"
export INFRA_MAP_VAULT_TOKEN="your_vaultwarden_token"
TUI Keybindings
| Key | Action |
|---|---|
1-9 |
Switch to tab 1-9 |
Tab / Shift+Tab |
Next/Previous tab |
↑ / ↓ |
Navigate lists |
Enter |
Select/Drill down |
r |
Refresh all services |
Space |
Toggle auto-refresh |
/ |
Filter mode |
: |
Command palette |
e |
Export topology (JSON) |
o |
Open in browser |
L |
View logs |
s |
SSH into machine |
h / ? |
Toggle help |
q / Esc |
Quit (confirm on main screen) |
Commands (via :)
:refresh Refresh all services
:export Export topology to JSON
:tab <name> Switch to tab (e.g., :tab matrix)
:filter <text> Set filter
:help Show help
:quit / :exit Quit application
Screenshots
(TUI screenshots would go here)
Configuration
The application reads configuration from:
cyper-nix/flake.nix- Machine and service definitions- Environment variables - Auth tokens
- Command line args - Overrides
Default Check Intervals
| Service | Interval |
|---|---|
| Matrix | 30s |
| Forgejo | 60s |
| SearXNG | 60s |
| Vaultwarden | 60s |
| Mastodon | 60s |
| Kanidm | 60s |
| Prometheus | 30s |
| Grafana | 60s |
| Coturn | 300s |
| LiveKit | 60s |
Development
Prerequisites
- Rust 1.79+
cyper-nixrepository checked out at../cyper-nix(or specify with--flake-path)
Building
cargo build --release --workspace
Testing
cargo test --workspace
Linting
cargo fmt --all -- --check
cargo clippy --workspace --all-targets -- -D warnings
cargo audit
CI/CD
Woodpecker pipeline (.woodpecker.yml):
- fmt: Code formatting check
- clippy: Linting with deny warnings
- test: Full test suite
- build: Release build
- audit: Security audit
- docs: Documentation generation
- release: Binary build and strip on version tags
Project Structure
infra-map/
├── Cargo.toml # Workspace root
├── .woodpecker.yml # CI pipeline
├── src/
│ └── main.rs # Binary entry point
├── crates/
│ ├── infra-core/ # Core data models
│ ├── infra-discovery/ # Nix flake parsing & static discovery
│ ├── infra-api/ # Live API clients
│ ├── infra-monitor/ # Real-time health monitoring
│ └── infra-tui/ # Ratatui TUI application
└── tests/ # Integration tests
Data Flow
cyper-nix/flake.nix
│
▼
StaticDiscovery (infra-discovery)
│
▼
NetworkTopology (machines, services, connections)
│
▼
HealthMonitor (infra-monitor) ◄── ApiClients (infra-api) ──► Live APIs
│
▼
ClusterHealth (watch channel)
│
▼
App (infra-tui) ──► Terminal (ratatui/crossterm)
License
MIT OR Apache-2.0