- Add automatic SD image builds for Raspberry Pi via Forgejo Actions - Enable binfmt emulation on cryodev-main for aarch64 cross-builds - Add sd-image.nix module to cryodev-pi configuration - Create comprehensive docs/ structure with installation guides - Split installation docs into: first-install (server), reinstall, new-client (Pi) - Add lib/utils.nix and apps/rebuild from synix - Fix headplane module for new upstream API (tale/headplane) - Fix various module issues (mailserver stateVersion, option conflicts) - Add placeholder secrets.yaml files for both hosts - Remove old INSTRUCTIONS.md (content moved to docs/)
116 lines
2.8 KiB
Markdown
116 lines
2.8 KiB
Markdown
# SD-Karten-Images für Raspberry Pi
|
|
|
|
Das Repository baut automatisch SD-Karten-Images für alle konfigurierten Raspberry Pi Hosts.
|
|
|
|
## Automatischer Build
|
|
|
|
Bei Änderungen an `main` werden automatisch Images für alle Pi-Hosts gebaut und als Release veröffentlicht.
|
|
|
|
**Download:** [Releases auf Forgejo](https://git.cryodev.xyz/steffen/cryodev-server/releases)
|
|
|
|
## Verfügbare Images
|
|
|
|
| Host | Image-Name |
|
|
|------|------------|
|
|
| `cryodev-pi` | `cryodev-pi-sd-image.img.zst` |
|
|
|
|
Neue Hosts werden automatisch gebaut, wenn sie zur Workflow-Matrix hinzugefügt werden.
|
|
|
|
## Image flashen
|
|
|
|
### 1. Herunterladen
|
|
|
|
```bash
|
|
wget https://git.cryodev.xyz/.../releases/latest/download/<hostname>-sd-image.img.zst
|
|
wget https://git.cryodev.xyz/.../releases/latest/download/<hostname>-sd-image.img.zst.sha256
|
|
|
|
# Checksum prüfen
|
|
sha256sum -c <hostname>-sd-image.img.zst.sha256
|
|
```
|
|
|
|
### 2. Dekomprimieren
|
|
|
|
```bash
|
|
zstd -d <hostname>-sd-image.img.zst -o <hostname>.img
|
|
```
|
|
|
|
### 3. Auf SD-Karte schreiben
|
|
|
|
```bash
|
|
# Richtiges Gerät finden
|
|
lsblk
|
|
|
|
# Schreiben (ACHTUNG: richtiges Gerät wählen!)
|
|
sudo dd if=<hostname>.img of=/dev/sdX bs=4M conv=fsync status=progress
|
|
```
|
|
|
|
Alternativ: `balenaEtcher` oder `Raspberry Pi Imager` verwenden.
|
|
|
|
## Was ist im Image?
|
|
|
|
- Vollständige NixOS-Installation für den spezifischen Host
|
|
- Alle konfigurierten Services (außer Secrets)
|
|
- SSH-Server aktiviert
|
|
- Automatische Root-Partition-Erweiterung beim ersten Boot
|
|
- Comin für automatische Updates
|
|
|
|
## Was fehlt?
|
|
|
|
**SOPS-Secrets** können nicht im Image enthalten sein (Henne-Ei-Problem mit SSH-Host-Key).
|
|
|
|
Nach dem ersten Boot:
|
|
1. Age-Key vom Pi holen
|
|
2. `.sops.yaml` aktualisieren
|
|
3. `secrets.yaml` erstellen
|
|
4. Konfiguration deployen
|
|
|
|
Siehe [Neuen Client hinzufügen](new-client.md) für die vollständige Anleitung.
|
|
|
|
## Neuen Host zur Pipeline hinzufügen
|
|
|
|
1. Host-Konfiguration in `hosts/<hostname>/` erstellen
|
|
2. In `.forgejo/workflows/build-pi-image.yml` zur Matrix hinzufügen:
|
|
|
|
```yaml
|
|
matrix:
|
|
host: [cryodev-pi, neuer-host] # <- hier hinzufügen
|
|
```
|
|
|
|
3. Push auf `main` → Image wird automatisch gebaut
|
|
|
|
## Manuell bauen
|
|
|
|
```bash
|
|
# Auf aarch64 (z.B. anderem Pi)
|
|
nix build .#nixosConfigurations.<hostname>.config.system.build.sdImage
|
|
|
|
# Auf x86_64 mit QEMU-Emulation (langsam)
|
|
nix build .#nixosConfigurations.<hostname>.config.system.build.sdImage \
|
|
--extra-platforms aarch64-linux
|
|
```
|
|
|
|
Voraussetzung auf x86_64:
|
|
|
|
```nix
|
|
{
|
|
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
|
|
}
|
|
```
|
|
|
|
## Troubleshooting
|
|
|
|
### Workflow schlägt fehl
|
|
|
|
- Prüfe ob `sd-image.nix` in der Host-Konfiguration importiert wird
|
|
- Prüfe ob binfmt auf cryodev-main aktiviert ist
|
|
|
|
### Image bootet nicht
|
|
|
|
- SD-Karte korrekt beschrieben?
|
|
- Andere SD-Karte versuchen
|
|
- Stromversorgung prüfen (min. 3A für Pi 4)
|
|
|
|
### Kein Netzwerk
|
|
|
|
- Ethernet-Kabel prüfen
|
|
- DHCP-Server im Netzwerk?
|