feat(prm-1): add T3 Code server and agent-lib skill sync

- Run T3 Code as a systemd service on AZ-PRM-1, reachable on the NetBird interface (port 3773), with its token in the agenix secret t3code-env
- Install claude-code, opencode, agent-lib and t3code in the sascha.koenig home profile on PRM-1
- Add an hourly agent-lib-sync timer that pulls skills and agents from agent-prod and links skills into ~/.claude/skills
- Add the numtide llm-agents binary cache to nix settings so the agent packages are not built locally
- Add a compat option shim for programs.nushell.loadSessionVariables until home-manager is upgraded to 26.11
- Update flake.lock inputs
- Remove the manual wartungsmodus rollout guide from docs/deploy
This commit is contained in:
2026-11-09 07:51:33 +01:00
parent 912e7617c1
commit cddb3c33d8
11 changed files with 208 additions and 262 deletions
@@ -1,204 +0,0 @@
# Rollout zentraler Wartungsmodus (manueller Deploy-Guide)
> **Für den Owner:** Diese Anleitung rollt das zentrale Wartungsmodul
> (`hosts/common/extraServices/maintenance/`) manuell aus — **CLD-1 zuerst**
> (Null-Verhaltensänderung am Produktivhost beweisen), **dann PRM-1**.
> Alle Befehle auf den Hosts werden per SSH als Administrator ausgeführt,
> Deploy-Befehle im Repo-Checkout. Geschätzte Gesamtdauer: ~30 Minuten.
## Was wird ausgerollt
- **Zentrales Wartungsmodul** statt des bisherigen CLD-1-eigenen Moduls.
Bedienung bleibt pro Host per SSH über das `maintenance`-CLI.
- **CLD-1:** Umstellung auf das zentrale Modul — `maintenance list` zeigt
danach **16 Dienste**. Keine Verhaltensänderung erwartet (YAML-Format,
Pfade und Abläufe sind byte-kompatibel übernommen).
- **PRM-1:** Neu-Aktivierung des Wartungsmoduls — `maintenance list` zeigt
danach **18 Dienste** (inkl. der drei weitergeleiteten Dienste PRTG,
Home Assistant, AZDesk). ntfy-Ziel ist hier zentral:
`https://ping.az-gruppe.com`.
- **Error-Pages:** Ungeplante Ausfälle (502–504) zeigen künftig die
Wartungsseite statt einer kargen Traefik-Fehlermeldung — auf **beiden**
Hosts. PRM-1 wird mit diesem Deploy frisch verkabelt (alle 19
nutzerseitigen Router; bewusste Ausnahmen: Traefik-Dashboard `r.l` und
`loki-push`, die echte Statuscodes brauchen). Blackbox-Probes sehen
weiterhin echte 502–504 (keine `statusRewrites`) — Monitoring-Alarme
ändern sich also nicht.
## Kurzreferenz: Das `maintenance`-CLI (auf dem Host)
```bash
maintenance on <dienst> [dauer] # Wartung AN; Dauer wie 30m, 2h (Default: 4h); 0 = ohne Auto-Aus
maintenance off <dienst> # Wartung sofort AUS
maintenance status # aktive Wartungen + Restdauer
maintenance status --json # maschinenlesbar (Format v1)
maintenance list # alle schaltbaren Dienste
maintenance expire-sweep # abgelaufene Wartungen manuell aufräumen
```
- Der Usage-Header zeigt den **echten Hostnamen** (gut als Sanity-Check,
dass man auf dem richtigen Host gelandet ist).
- Wirksamkeit: ~1–2 Sekunden (Traefik überwacht das
Konfigurationsverzeichnis live). Kein Rebuild, kein Neustart.
- Schalter pro Dienst: Router-YAML
`/var/lib/traefik/dynamic/maintenance-<dienst>.yml` (priority 1000,
tls certResolver ionos) — Datei rein = an, raus = aus. Auto-Aus-State:
`/var/lib/maintenance/<dienst>.expires`.
## 1. Vorab-Check (im Repo, vor jedem Deploy)
- [ ] Tickets 02 (CLD-1-Umstellung) und 03 (PRM-1-Aktivierung) sind
umgesetzt und auf dem Branch `wartungsmodus-zentral` committet.
- [ ] Evaluierung **aller drei Hosts** läuft sauber durch (nur bewerten,
nichts bauen/deployen):
```bash
nix eval .#nixosConfigurations.AZ-CLD-1.config.system.build.toplevel.drvPath
nix eval .#nixosConfigurations.AZ-PRM-1.config.system.build.toplevel.drvPath
nix eval .#nixosConfigurations.AZ-PLT-1.config.system.build.toplevel.drvPath
```
Jeder Befehl muss einen Store-Derivation-Pfad ausgeben (`.drv`) und darf
keine Assertion/Fehler melden. (Alternative: `nix build` je Host bzw.
`colmena build` — Evaluierung genügt hier.)
## 2. Deploy AZ-CLD-1
- [ ] Deploy starten:
```bash
nix develop -c colmena apply AZ-CLD-1
```
- [ ] Erwartung: **Null Verhaltensänderung.** Der Host lief schon mit
Wartungsmodus — die Umstellung ist ein interner Umbau (Expand-Contract
abgeschlossen). Insbesondere überleben:
- laufende Wartungen (`/var/lib/traefik/dynamic/maintenance-*.yml`
bleiben unangetastet, Traefik liest sie weiter),
- der ntfy-Token in `/var/lib/maintenance/ntfy-token`,
- laufende Auto-Aus-Timer bzw. der Expiry-State in
`/var/lib/maintenance/*.expires`.
## 3. Smoke-Test CLD-1 (per SSH auf AZ-CLD-1)
Checkliste zum Abhaken — Testdienst z. B. `tools` (IT-Tools, unkritisch):
- [ ] `maintenance list` zeigt **alle 16 Dienste** (am, baserow, chat,
chat-dev, dash, git, kpi, llm, netbird, pg, ping, pw, tickets, tools,
wf, wiki).
- [ ] Wartung einschalten: `maintenance on tools 1m`
- [ ] `maintenance status` zeigt `tools` als aktiv mit ~1 Minute Restdauer.
- [ ] `maintenance status --json` zeigt den Dienst aktiv
(Felder `service`, `remaining_seconds`, `auto_off: true`; Hostname
muss `AZ-CLD-1` sein).
- [ ] Wartungsseite prüfen — Browser `https://tools.az-gruppe.com` oder
direkt auf dem Host:
```bash
# Status + Header:
curl -k -sSI -H "Host: tools.az-gruppe.com" https://localhost/ | head -5
# Seiteninhalt (Wartungsseite mit Dienstnamen „IT-Tools"):
curl -k -H "Host: tools.az-gruppe.com" https://localhost/ | head -20
```
Erwartet: **HTTP 503**, dazu `Retry-After: 60`, `Cache-Control: no-store`,
`X-Robots-Tag: noindex, nofollow`. Die Seite nennt den Dienst namentlich und lädt
nach 60 s automatisch neu (im Browser gut sichtbar).
- [ ] Nach ~1 Minute: Auto-Aus verifizieren — `maintenance status` zeigt
den Dienst nicht mehr, `https://tools.az-gruppe.com` liefert wieder
die Anwendung.
- [ ] Fallback, falls Auto-Aus versagt: `maintenance off tools`
## 4. Rollback-Pfad CLD-1 (falls etwas schiefläuft)
Kurz: `nix develop -c colmena rollback AZ-CLD-1` setzt **nur diesen Host**
auf die vorherige NixOS-Generation zurück (PRM-1/PLT-1 bleiben unberührt;
ohne Host-Argument würde colmena die gesamte Deployment-Menge zurücksetzen).
Chirurgische Alternative: beim Boot den vorherigen Generation-Eintrag im
NixOS-Boot-Menü wählen. Zustand unter `/var/lib/*` (laufende Wartungen,
Token) bleibt dabei erhalten.
## 5. Deploy AZ-PRM-1
Erst weitermachen, wenn der CLD-1-Smoke-Test komplett grün ist.
- [ ] Deploy starten:
```bash
nix develop -c colmena apply AZ-PRM-1
```
- [ ] Ein Deploy deckt alles ab: Wartungsmodul inkl. CLI, Registry
(18 Dienste), Wartungsseite und die frisch verkabelte
`error-pages`-Middleware in allen 19 nutzerseitigen Routern.
## 6. Smoke-Test PRM-1 (per SSH auf AZ-PRM-1)
Checkliste — bewusst unkritischer Testdienst, z. B. `draw` (Excalidraw)
oder `pdf` (Stirling PDF):
- [ ] `maintenance list` zeigt **alle 18 Dienste** (3dv, azess, azdesk,
azion, bpi, dns, draw, grafana, home-assistant, kestra, netbox, pb,
pdf, pg, pim, prtg, semaphore, wf).
- [ ] Testwartung einschalten: `maintenance on draw 1m`
- [ ] `maintenance status` zeigt `draw` aktiv mit ~1 Minute Restdauer.
- [ ] `maintenance status --json` zeigt `draw` als aktiv (Felder `service`,
`remaining_seconds`, `auto_off: true`) und als `host` **AZ-PRM-1** —
Sanity-Check, dass die Ausgabe wirklich von PRM-1 stammt und nicht
von einer vertauschten SSH-Sitzung.
- [ ] Wartungsseite direkt über Traefik prüfen (auf PRM-1 selbst):
```bash
# Status + Header:
curl -k -sSI -H "Host: draw.l.az-gruppe.com" https://localhost/ | head -5
# Seiteninhalt (Wartungsseite mit Dienstnamen „Excalidraw"):
curl -k -H "Host: draw.l.az-gruppe.com" https://localhost/ | head -20
```
Erwartet: **HTTP 503** + Wartungsseite (dieselben Header wie auf CLD-1:
`Retry-After: 60`, `no-store`, `X-Robots-Tag: noindex, nofollow`).
- [ ] Nach ~1 Minute: Auto-Aus verifizieren — `maintenance status` leer,
`draw.l.az-gruppe.com` liefert Excalidraw wieder.
- [ ] Fallback, falls Auto-Aus versagt: `maintenance off draw`
Hinweis Blackbox-Monitoring: Eine geplante Wartung auf einem der per
Blackbox-Probe überwachten Dienste (`g.l`, `wf.l`, `k.l`, `sem.l`) trifft
deren Probe mit HTTP 503 — der bestehende `probe_success == 0`-Alert feuert
dann während des Wartungsfensters. Das ist erwartetes Verhalten; den Alert
für die Dauer der Wartung ggf. quittieren bzw. stilllegen.
Rollback-Pfad wie unter 4., ebenfalls host-scoped:
`nix develop -c colmena rollback AZ-PRM-1` (bzw. NixOS-Boot-Menü).
## 7. ntfy auf PRM-1 (optional, empfohlen)
PRM-1 benachrichtigt über den zentralen ntfy-Server
(`notify.url = https://ping.az-gruppe.com`, bereits konfiguriert), Topic
ist das Team-Topic `wartung`. Einmalig einen Access-Token erzeugen —
analog zur CLD-1-Anleitung im Modul-README
(`hosts/common/extraServices/maintenance/README.md`):
```bash
mkdir -p /var/lib/maintenance
ntfy --url https://ping.az-gruppe.com user add svc-maintenance # interaktiv, einmalig
ntfy --url https://ping.az-gruppe.com access svc-maintenance wartung rw # Publish-Recht auf das Topic
ntfy --url https://ping.az-gruppe.com token add svc-maintenance # Token erzeugen (Ausgabe kopieren)
echo "tk_…" > /var/lib/maintenance/ntfy-token
chmod 600 /var/lib/maintenance/ntfy-token
```
Hinweis: Die `--url`-Angabe zielt die Befehle bewusst auf den zentralen
ntfy-Server `https://ping.az-gruppe.com` (PRM-1 betreibt keinen eigenen —
das CLI ist dort nicht auf einen Server voreingestellt). Danach bei
`maintenance on`/`off` eine Push aufs Team-Topic `wartung` testen. Ohne
Token-Datei läuft alles normal — nur ohne Push (best-effort, wirft keine
Fehler).
## Referenz: Wartungsseite (both hosts)
- Quelle: nginx auf `127.0.0.1:3090`, liefert HTTP 503 + `Retry-After: 60`,
`Cache-Control: no-store`, `X-Robots-Tag: noindex, nofollow`.
- Lädt nach 60 s automatisch neu (Nutzer finden von selbst zurück).
Kontaktzeile und Domain→Dienstname-Map (`service-map.js`, zur Build-Zeit
generiert) kommen aus der Konfiguration — nichts handzupflegen.
Generated
+57 -58
View File
@@ -23,11 +23,11 @@
"nixpkgs": "nixpkgs_3" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1790734419, "lastModified": 1792507013,
"narHash": "sha256-n7wew722m1OTBT9DOIMxNX/NF4zfsSUABAO5eW3wikE=", "narHash": "sha256-8tKjSQajD3mUND1GaAuaWTcuyUpgcGsh5V+l4ibzC7U=",
"owner": "ryantm", "owner": "ryantm",
"repo": "agenix", "repo": "agenix",
"rev": "3daa710894355fa2fad8243380af373a2b4046ef", "rev": "5e5b88a0c8e56f291a108c2fe9934054d9745b2e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -297,11 +297,11 @@
"treefmt-nix": "treefmt-nix_2" "treefmt-nix": "treefmt-nix_2"
}, },
"locked": { "locked": {
"lastModified": 1791368707, "lastModified": 1792485075,
"narHash": "sha256-HmIA3HZYBSBhzUF7TZ0HDx0+DyVg4iNWJhqRoG8xZjQ=", "narHash": "sha256-o04WvscL+MhtarpbluifQZLA6lIP3B0g6NDUWaM/asc=",
"owner": "mulatta", "owner": "mulatta",
"repo": "buzz.nix", "repo": "buzz.nix",
"rev": "3feda8d4f2435d430e46b204d88569d99e821839", "rev": "22a9f566d21317181b4b40601570e81a02ff2d8c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -361,17 +361,16 @@
"dank-qml-common": { "dank-qml-common": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1791392812, "lastModified": 1792513666,
"narHash": "sha256-id6Y5XNO5K3KfXSOsEYVUwiq1ygYGNX5LeKSgHM3GR8=", "narHash": "sha256-RDqPdPrM5lnwRrfFGLz3IwgTjCV2Ie+nrTD3ldj1t/s=",
"owner": "AvengeMedia", "owner": "duxlabs-dev",
"repo": "dank-qml-common", "repo": "dux-qml-common",
"rev": "1ae722232da7110d26cd2c355b6615e078e94197", "rev": "ebf5e6c002da1bdaa4aaa2f319fea7b8507abc42",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "AvengeMedia", "owner": "duxlabs-dev",
"ref": "stable-1.6", "repo": "dux-qml-common",
"repo": "dank-qml-common",
"type": "github" "type": "github"
} }
}, },
@@ -427,11 +426,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1791395223, "lastModified": 1792523829,
"narHash": "sha256-yDBOoDewH8LwfsZrG4x5vaCstmp6w2vV70j9hC6dIuk=", "narHash": "sha256-hyWdbsyOGXsJxvXG4Tqg0uRI1s3JwPi8DKyWips3Ta8=",
"owner": "AvengeMedia", "owner": "AvengeMedia",
"repo": "DankMaterialShell", "repo": "DankMaterialShell",
"rev": "4a87e8227daf0840b3376fd5e7f891f5900165a6", "rev": "9b413296b16721f7679fb62e624cb1ed2433fa58",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -449,11 +448,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1791687633, "lastModified": 1792981560,
"narHash": "sha256-RPGDUgqwN/VFBncZvdCuG2y0HxB67vpze0Lf6AgWkro=", "narHash": "sha256-wTMsaavNJwgGOX991oIa6xgDWHwJnWdi9bwwQsjGkAg=",
"owner": "AvengeMedia", "owner": "AvengeMedia",
"repo": "dms-plugin-registry", "repo": "dms-plugin-registry",
"rev": "0af39503cb830db485148ce9fa30fcd65c6774e3", "rev": "cb788da6d2e6cf20205784c0baca041e48183612",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -502,11 +501,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1790898470, "lastModified": 1793576659,
"narHash": "sha256-zTwuwezD0w3hpga6a6P8emidzAZFyWqlNeRBlpWOOl8=", "narHash": "sha256-V1h85lUaJBQoHFrB2vpXZOE0Ju1MYSnIpsehoVZYlDo=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "024633cd702b10285db5cb19b40ad48d2399ba60", "rev": "ea2630b7470978622c7689a1ff75d2b389175399",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -695,11 +694,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1791642191, "lastModified": 1792896866,
"narHash": "sha256-0bK0A59rVUn1SRZzo4cNi4VSqAe7vR1gL2/MZl53Frw=", "narHash": "sha256-/0tELNnhdSnP+bHSdWiEe6KpfSwi6WrTnT9cm/jNkjA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "c58f54c733a7894d84fa2fdff26cc12088c4b78c", "rev": "c216bf5a1f173b0481bd5c8c489ebe5595ecc68c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -717,11 +716,11 @@
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
}, },
"locked": { "locked": {
"lastModified": 1791976318, "lastModified": 1794201582,
"narHash": "sha256-w7gcrqJmQ7jBezXvudA5GpZGh7ELzz0j/oolYUuSzT8=", "narHash": "sha256-ejT2Q+iCRP2/oL+58pb5/UGZ53cWVLqU5ob58EucyZk=",
"owner": "numtide", "owner": "numtide",
"repo": "llm-agents.nix", "repo": "llm-agents.nix",
"rev": "42e40703df50a5357841310209d9023e8c321458", "rev": "3327b7d82f31f2444533e935f06caf1a1b4da18c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -746,11 +745,11 @@
"nur": "nur" "nur": "nur"
}, },
"locked": { "locked": {
"lastModified": 1791721658, "lastModified": 1793861950,
"narHash": "sha256-oV/j/cUpyV6Ur5uBsR//1WFHSr55cXYcqKs/VVlVT24=", "narHash": "sha256-JHY98EHKxanAYUICtBbdlDDRyWv1jJ89ve7I8+StoH0=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "89877589dba02b120b98e27f3102afcf43371111", "rev": "b63db504851ec072e1f58b4b2ebbc226b525840c",
"revCount": 153, "revCount": 184,
"type": "git", "type": "git",
"url": "ssh://gitea@code.m3ta.dev/m3tam3re/m3ta-home" "url": "ssh://gitea@code.m3ta.dev/m3tam3re/m3ta-home"
}, },
@@ -772,11 +771,11 @@
"opencode": "opencode" "opencode": "opencode"
}, },
"locked": { "locked": {
"lastModified": 1791720072, "lastModified": 1792997202,
"narHash": "sha256-Cwil+4pdKcBg0xS3C+AEkdzi0DIiSs/ZU6RGNxVU78w=", "narHash": "sha256-tHNAo+Yc/7oUzxvnkAnximNt4MPRy2sW0tQAZ1Jq6oo=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "ebd79d5ca5ff5e8143770ca43486199260c0d880", "rev": "72695e2ef0b4f476ea28979dfdcd5a659d9496ce",
"revCount": 402, "revCount": 411,
"type": "git", "type": "git",
"url": "ssh://gitea@code.m3ta.dev/m3tam3re/nixpkgs" "url": "ssh://gitea@code.m3ta.dev/m3tam3re/nixpkgs"
}, },
@@ -1022,11 +1021,11 @@
}, },
"nixpkgs-master": { "nixpkgs-master": {
"locked": { "locked": {
"lastModified": 1791717656, "lastModified": 1792653584,
"narHash": "sha256-NHZsKA3fUek3FlFk9yIAdM/+C3JlUxqHHFini7BevD0=", "narHash": "sha256-vniEjRZ2skWqpreoaSJt7MCXDc/uZI/+ZDdLSa1/h6I=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "f38d30d14a7442201671d50c86a2ec719978168e", "rev": "6c21ae394d8839a9d4cad6e2fb2f312ebef0447b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -1118,11 +1117,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1791487292, "lastModified": 1793826729,
"narHash": "sha256-tqM7xDEsaeK1p6VvRygeZ9LkQRpUUkbRT02BHv6hnTM=", "narHash": "sha256-D5H7H+qMoTGI/jJtxKP4u7BdjkFnUyhOovTrf3pTOr0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "8edc0c72e3a38faf5434e40d1f19431125fe4b30", "rev": "6dadaf4375be35033e1c84395adbd53ff5fded96",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -1182,11 +1181,11 @@
}, },
"nixpkgs_6": { "nixpkgs_6": {
"locked": { "locked": {
"lastModified": 1791594108, "lastModified": 1792773339,
"narHash": "sha256-XK4KceonkwD8LuMAt/vNrz982mXJM5jeHAxMwsUXXAQ=", "narHash": "sha256-rZLrzrC6i+jnTAlvPZHogKDulY7WWDEv9hJeHieO7Zw=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "6510408d147d8c5e6d76043e899e9251756f6a75", "rev": "3ec636362e1816bc2f0888fa0fa2c69f1bc9e504",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -1272,11 +1271,11 @@
"nixpkgs": "nixpkgs_6" "nixpkgs": "nixpkgs_6"
}, },
"locked": { "locked": {
"lastModified": 1791719755, "lastModified": 1792997485,
"narHash": "sha256-M4t6O22ztEmlx4q3QO9dNkrdJlYKe2pNIeHeo0Zgcrw=", "narHash": "sha256-f4HoNZ30TvZgK/uaZAxTCGeV3XDW2DPdcuiM1azihKw=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "1ad0fa913b720c96f0caadaece4c214f93d99eb0", "rev": "01c200726e3d527b5101b440be0ab19a7f74cba1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -1311,11 +1310,11 @@
"nixpkgs": "nixpkgs_5" "nixpkgs": "nixpkgs_5"
}, },
"locked": { "locked": {
"lastModified": 1791710828, "lastModified": 1792644899,
"narHash": "sha256-Kk5uJmhse0sKaAWg2fUC7GiAJDPIdzm9xyBLjvh5EUc=", "narHash": "sha256-ub192yT1SwxVyf2DHKW34xHJnL/LXRi2jm1IFyZMkqQ=",
"owner": "anomalyco", "owner": "anomalyco",
"repo": "opencode", "repo": "opencode",
"rev": "d21b0790a6c146815f28fea604e41e922f009590", "rev": "c93aaae37157d785f76a8e9a9243a6560e286468",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -1473,11 +1472,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1791013993, "lastModified": 1792219666,
"narHash": "sha256-BiFPwFsbFnZH5GfWbQFKYuQNg+67aNQCoRSRNTeJFQc=", "narHash": "sha256-RMO08tKD+hFIL5ryWi85VY4aHE5oIpdV1h4kVFctOkw=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "7470661ba2b51156048af08464b82020223dc942", "rev": "a110337465cfb76e3806b81b9db3094c3e6e770a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -1600,11 +1599,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1790542030, "lastModified": 1791885023,
"narHash": "sha256-U6m0B5+ALyOLYG4OVvtguLdem7iYgN6cIP5Q1RhM+g8=", "narHash": "sha256-C3alQ2MEt0zVrUSho5NUDo3jmhbff72++bfwoqT9Omo=",
"owner": "numtide", "owner": "numtide",
"repo": "treefmt-nix", "repo": "treefmt-nix",
"rev": "6aca3b3649eb1edf472eca3e91e6bcc0c84a6ad3", "rev": "0d6d739a833ba9a9c93034862e4a7b061a062a1c",
"type": "github" "type": "github"
}, },
"original": { "original": {
+21
View File
@@ -0,0 +1,21 @@
# Home-Manager-Overrides fuer sascha.koenig auf AZ-PRM-1.
# Wird automatisch von hosts/common/users/sascha.koenig.nix eingebunden.
#
# T3 Code (hosts/AZ-PRM-1/services/t3code.nix) startet die Harnesses aus
# /etc/profiles/per-user/<user>, deshalb liegen sie hier im User-Profil.
{pkgs, ...}: {
home.packages = with pkgs; [
agent-lib
claude-code
opencode
# Gleiches Paket wie der Dienst: fuer `t3 pair` & Co. gegen ~/.t3.
t3code
];
# Gleiche Quelle wie der Timer agent-lib-sync, damit ein manuelles
# `agent-lib sync` / `agent-lib status` ohne --repo funktioniert.
xdg.configFile."agent-lib/config.json".text = builtins.toJSON {
repo_url = "https://code.m3ta.dev/m3tam3re/agent-prod.git";
ref = "master";
};
}
+6
View File
@@ -93,6 +93,12 @@ in {
technitium-env = { technitium-env = {
file = ../../secrets/technitium-env.age; file = ../../secrets/technitium-env.age;
}; };
# Harness-Tokens fuer den T3-Code-Server (systemd EnvironmentFile).
t3code-env = {
file = ../../secrets/t3code-env.age;
owner = "sascha.koenig";
mode = "0400";
};
} }
// lib.optionalAttrs (builtins.pathExists ntfyGrafanaWebhookSecret) { // lib.optionalAttrs (builtins.pathExists ntfyGrafanaWebhookSecret) {
ntfy-grafana-webhook = { ntfy-grafana-webhook = {
+1
View File
@@ -13,6 +13,7 @@
./phishboard.nix ./phishboard.nix
./postgres.nix ./postgres.nix
./printing.nix ./printing.nix
./t3code.nix
./traefik.nix ./traefik.nix
./traefik-routing.nix ./traefik-routing.nix
./zugferd.nix ./zugferd.nix
+103
View File
@@ -0,0 +1,103 @@
# T3 Code Server + agent-lib Skill-Sync auf AZ-PRM-1.
#
# T3 Code laeuft als systemd-Dienst ueber das m3ta-home-Modul und ist nur im
# NetBird-Netz (wt0) erreichbar. Die Harnesses (claude-code, opencode) kommen
# aus dem Home-Manager-Profil des Benutzers (hosts/AZ-PRM-1/home.nix), nicht
# aus dem Dienst selbst.
#
# agent-lib zieht Skills und Agents aus dem Arbeits-Repo agent-prod nach
# ~/.agents/skills und ~/.config/opencode/{agents,commands}. Claude Code liest
# ~/.claude/skills, deshalb werden die Skill-Ordner danach dorthin verlinkt
# (gleiche Logik wie m3ta-home profiles/sets/coding/agents/claude-skills.nix,
# hier jedoch im System-Dienst, weil es auf dem Server keine User-Session gibt).
#
# Erst-Deploy: Der Dienst haengt am wt0-Device und startet nicht automatisch,
# wenn das Interface beim Aktivieren schon oben ist -> einmal
# `systemctl start t3code`. Danach `systemctl start agent-lib-sync` fuer den
# ersten Skill-Abgleich (sonst laeuft er beim naechsten Timer-Tick).
{
config,
inputs,
lib,
pkgs,
...
}: let
user = "sascha.koenig";
home = config.users.users.${user}.home;
agentProdRepo = "https://code.m3ta.dev/m3tam3re/agent-prod.git";
agentProdRef = "master";
skillsSrc = "${home}/.agents/skills";
skillsDst = "${home}/.claude/skills";
agentLibSync = pkgs.writeShellApplication {
name = "agent-lib-sync";
runtimeInputs = [pkgs.agent-lib pkgs.coreutils];
text = ''
src=${lib.escapeShellArg skillsSrc}
dst=${lib.escapeShellArg skillsDst}
agent-lib sync --repo ${lib.escapeShellArg agentProdRepo} --ref ${lib.escapeShellArg agentProdRef}
mkdir -p "$src" "$dst"
# Links in $dst entfernen, deren Ziel in $src verschwunden ist.
for link in "$dst"/*; do
[ -L "$link" ] || continue
case "$(readlink "$link")" in
"$src"/*) [ -e "$link" ] || rm -f "$link" ;;
esac
done
# Jeden Skill-Ordner verlinken; echte Ordner oder fremde Links nie ersetzen.
for skill in "$src"/*/; do
skill="''${skill%/}"
[ -f "$skill/SKILL.md" ] || continue
name="$(basename "$skill")"
target="$dst/$name"
if [ -L "$target" ] || [ ! -e "$target" ]; then
ln -sfn "$skill" "$target"
fi
done
'';
};
in {
imports = [inputs.m3ta-home.nixosModules.t3code];
m3ta.t3code = {
enable = true;
inherit user;
port = config.m3ta.ports.get "t3code";
# Die llm-agents-Pakete liegen hier flach in pkgs (mkLlmAgentsOverlay),
# nicht unter pkgs.llm-agents wie im Modul-Default.
package = pkgs.t3code;
environmentFile = config.age.secrets.t3code-env.path;
};
# Stuendlicher Skill-Abgleich aus agent-prod ("Cron-Job").
systemd.services.agent-lib-sync = {
description = "agent-lib: Skills/Agents aus agent-prod synchronisieren";
after = ["network-online.target"];
wants = ["network-online.target"];
serviceConfig = {
Type = "oneshot";
User = user;
Group = "users";
WorkingDirectory = home;
ExecStart = lib.getExe agentLibSync;
};
environment.HOME = home;
};
systemd.timers.agent-lib-sync = {
description = "agent-lib Skill-Sync (stuendlich)";
wantedBy = ["timers.target"];
timerConfig = {
OnBootSec = "5min";
OnCalendar = "hourly";
RandomizedDelaySec = "10min";
Persistent = true;
};
};
}
+4
View File
@@ -57,6 +57,10 @@
nix = { nix = {
settings = { settings = {
experimental-features = "nix-command flakes"; experimental-features = "nix-command flakes";
# Binärcache von numtide/llm-agents.nix (claude-code, opencode, t3code,
# codex ...). Ohne ihn werden diese Pakete lokal gebaut (codex = Rust).
substituters = ["https://cache.numtide.com"];
trusted-public-keys = ["niks3.numtide.com-1:DTx8wZduET09hRmMtKdQDxNNthLQETkc/yaX7M4qK0g="];
trusted-users = [ trusted-users = [
"root" "root"
"sascha.koenig" "sascha.koenig"
+1
View File
@@ -24,6 +24,7 @@
homarr = 3057; homarr = 3057;
atrocore = 3058; atrocore = 3058;
semaphore = 3059; semaphore = 3059;
t3code = 3773;
metabase = 3013; metabase = 3013;
baserow = 3050; baserow = 3050;
+14
View File
@@ -12,12 +12,25 @@
# 3. Create hosts/<hostname>/home.nix if the host needs overrides (monitors, etc.) # 3. Create hosts/<hostname>/home.nix if the host needs overrides (monitors, etc.)
{ {
config, config,
lib,
pkgs, pkgs,
inputs, inputs,
... ...
}: let }: let
hostname = config.networking.hostName; hostname = config.networking.hostName;
# m3ta-home (ab 2026-11-03) setzt programs.nushell.loadSessionVariables,
# eine Option, die erst in home-manager 26.11 existiert. Wir fahren noch
# release-26.05, deshalb wird die Option hier deklariert und ignoriert.
# Entfernen, sobald home-manager auf release-26.11 gehoben ist.
nushellCompatShim = {
options.programs.nushell.loadSessionVariables = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Compat-Shim fuer home-manager < 26.11; ohne Wirkung.";
};
};
# ── Per-host profile mapping ── # ── Per-host profile mapping ──
# Determines which m3ta-home context and sets each host gets. # Determines which m3ta-home context and sets each host gets.
hostProfiles = { hostProfiles = {
@@ -113,6 +126,7 @@ in {
}) })
# Per-host feature flags # Per-host feature flags
hostFlags hostFlags
nushellCompatShim
] ]
# Per-host home.nix (Hyprland monitors, XDG/MIME, HW-specific overrides) # Per-host home.nix (Hyprland monitors, XDG/MIME, HW-specific overrides)
++ ( ++ (
+1
View File
@@ -72,4 +72,5 @@ in {
"secrets/ntfy-grafana-webhook.age".publicKeys = systems ++ users; "secrets/ntfy-grafana-webhook.age".publicKeys = systems ++ users;
"secrets/semaphore-env.age".publicKeys = [AZ-PRM-1] ++ users; "secrets/semaphore-env.age".publicKeys = [AZ-PRM-1] ++ users;
"secrets/technitium-env.age".publicKeys = [AZ-PRM-1] ++ users; "secrets/technitium-env.age".publicKeys = [AZ-PRM-1] ++ users;
"secrets/t3code-env.age".publicKeys = [AZ-PRM-1] ++ users;
} }
Binary file not shown.