homelab/scripts/generate-docs.sh
plasmagoat bcbcc8b17b
Some checks failed
Test / tests (push) Has been cancelled
/ OpenTofu (push) Has been cancelled
homelab framework module init (everything is a mess)
2025-07-28 02:05:13 +02:00

41 lines
1.1 KiB
Bash
Executable file

# scripts/generate-docs.sh
#!/bin/bash
echo "# Homelab Global Configuration Documentation"
echo
echo "This document describes the global configuration system for the NixOS homelab."
echo
echo "## Available Services"
echo
# List all service modules
find modules/nixos/services -name "*.nix" | while read -r file; do
service=$(basename "$file" .nix)
echo "### $service"
echo
# Extract description from the module
grep -m1 "mkEnableOption" "$file" | sed 's/.*mkEnableOption "\([^"]*\)".*/\1/' || echo "Service module for $service"
echo
done
echo "## Configuration Examples"
echo
echo "### Basic Media Server Setup"
echo '```nix'
echo 'media-server = { ... }: {'
echo ' homelab.global = {'
echo ' enable = true;'
echo ' hostname = "media-server";'
echo ' domain = "homelab.local";'
echo ' };'
echo ' services.jellyfin.enable = true;'
echo '};'
echo '```'
echo
echo "### Monitoring Configuration"
echo '```nix'
echo 'monitoring = { nodes, ... }: {'
echo ' services.prometheus.scrapeConfigs = collectMonitoringEndpoints nodes;'
echo '};'
echo '```'# modules/global-config.nix