feat(m3-kratos): run T3 Code as a service on the NetBird IP #31

Merged
m3ta-chiron merged 1 commits from feat/m3-kratos-t3code-service into master 2026-11-01 13:54:18 +01:00
Collaborator

Summary

  • Adds a t3code systemd service on m3-kratos that runs t3 serve --host 100.81.73.194 as m3tam3re, so T3 Code binds to the NetBird address instead of depending on the desktop app.
  • Keeps HOME=/home/m3tam3re, so the existing ~/.t3 state and threads are reused.
  • Sets the port from m3ta.ports.get "t3code" and opens it only on the wt0 (NetBird) interface.
  • Removes the T3CODE_DESKTOP_LAN_HOST session variable from #30. The desktop app ignores --host, so the mesh-name override is no longer needed.
  • The NetBird IP is hardcoded. If NetBird reassigns it, the service stops starting until the value is updated.
  • Deploying this requires turning off the desktop app's local environment first. Otherwise the app holds the ~/.t3 lock and the service keeps retrying.

Testing

  • nix build .#nixosConfigurations.m3-kratos.config.system.build.toplevel completes.
  • alejandra and statix were run on hosts/m3-kratos/services/t3code.nix. Re-run them before merge to confirm a clean result.
  • Not run: nixos-rebuild switch on m3-kratos.
  • Not run: confirm the service is active and port 3773 listens on 100.81.73.194 (ss -ltn).
  • Not run: t3 pair and pairing the desktop app and a second mesh device against the new URL.
## Summary - Adds a `t3code` systemd service on m3-kratos that runs `t3 serve --host 100.81.73.194` as `m3tam3re`, so T3 Code binds to the NetBird address instead of depending on the desktop app. - Keeps `HOME=/home/m3tam3re`, so the existing `~/.t3` state and threads are reused. - Sets the port from `m3ta.ports.get "t3code"` and opens it only on the `wt0` (NetBird) interface. - Removes the `T3CODE_DESKTOP_LAN_HOST` session variable from #30. The desktop app ignores `--host`, so the mesh-name override is no longer needed. - The NetBird IP is hardcoded. If NetBird reassigns it, the service stops starting until the value is updated. - Deploying this requires turning off the desktop app's local environment first. Otherwise the app holds the `~/.t3` lock and the service keeps retrying. ## Testing - `nix build .#nixosConfigurations.m3-kratos.config.system.build.toplevel` completes. - `alejandra` and `statix` were run on `hosts/m3-kratos/services/t3code.nix`. Re-run them before merge to confirm a clean result. - Not run: `nixos-rebuild switch` on m3-kratos. - Not run: confirm the service is active and port 3773 listens on 100.81.73.194 (`ss -ltn`). - Not run: `t3 pair` and pairing the desktop app and a second mesh device against the new URL.
m3ta-chiron added 1 commit 2026-11-01 13:53:34 +01:00
The desktop app ignores --host, so its LAN host override goes away too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
m3ta-chiron merged commit ba302a8a00 into master 2026-11-01 13:54:18 +01:00
m3ta-chiron deleted branch feat/m3-kratos-t3code-service 2026-11-01 13:54:18 +01:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: m3tam3re/nixos-config#31