Compare commits

..
3 Commits
Author SHA1 Message Date
m3ta-chiron b63db50485 Merge branch 'master' of code.m3ta.dev:m3tam3re/m3ta-home 2026-11-05 07:59:10 +01:00
m3ta-chiron 11ddf5e00c Merge branch 'feat/t3code-environment-file' 2026-11-05 07:58:22 +01:00
m3ta-chironandClaude Opus 5.5 2187d9263d feat(t3code): add environmentFile option
Loads an optional KEY=value file (e.g. an agenix secret) as the
service's systemd EnvironmentFile. Store paths are rejected so secrets
cannot end up in the Nix store.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 07:48:18 +01:00
2 changed files with 17 additions and 0 deletions

No files matched your search

@@ -35,6 +35,7 @@ Agents committen auf beiden Hosts als `m3ta-chiron`.
| `m3ta.t3code.port` | port | `3773` | | `m3ta.t3code.port` | port | `3773` |
| `m3ta.t3code.interface` | str | `"wt0"` | | `m3ta.t3code.interface` | str | `"wt0"` |
| `m3ta.t3code.package` | package | `pkgs.llm-agents.t3code` | | `m3ta.t3code.package` | package | `pkgs.llm-agents.t3code` |
| `m3ta.t3code.environmentFile` | null oder absoluter Pfad außerhalb des Stores | `null` |
Eine Assertion verlangt `services.netbird.enable = true`. Eine Assertion verlangt `services.netbird.enable = true`.
@@ -42,6 +43,7 @@ Eine Assertion verlangt `services.netbird.enable = true`.
- Läuft als `user` mit Gruppe `users`; `HOME` und `WorkingDirectory` kommen aus `config.users.users.<user>.home`. - Läuft als `user` mit Gruppe `users`; `HOME` und `WorkingDirectory` kommen aus `config.users.users.<user>.home`.
- `T3CODE_PORT` kommt aus `port`. - `T3CODE_PORT` kommt aus `port`.
- `environmentFile` wird, falls gesetzt, als `EnvironmentFile` geladen (`KEY=value`-Zeilen, z. B. ein agenix-Secret).
- `path` enthält `/etc/profiles/per-user/<user>` und `/run/current-system/sw`. - `path` enthält `/etc/profiles/per-user/<user>` und `/run/current-system/sw`.
- `Restart = "on-failure"`, `RestartSec = 5`. - `Restart = "on-failure"`, `RestartSec = 5`.
- `bindsTo`, `after` und `wantedBy` zeigen auf `sys-subsystem-net-devices-<interface>.device`. - `bindsTo`, `after` und `wantedBy` zeigen auf `sys-subsystem-net-devices-<interface>.device`.
+15
View File
@@ -52,6 +52,20 @@ in {
defaultText = lib.literalExpression "pkgs.llm-agents.t3code"; defaultText = lib.literalExpression "pkgs.llm-agents.t3code";
description = "T3 Code package."; description = "T3 Code package.";
}; };
environmentFile = lib.mkOption {
type = lib.types.nullOr (lib.types.pathWith {
inStore = false;
absolute = true;
});
default = null;
example = "/run/agenix/t3code-env";
description = ''
File with `KEY=value` lines loaded into the server's environment
(systemd `EnvironmentFile`), e.g. tokens for the harnesses. Keep it
outside the Nix store, for example as an agenix secret.
'';
};
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
@@ -75,6 +89,7 @@ in {
ExecStart = "${serve}/bin/t3code-serve ${cfg.interface} ${cfg.package}/bin/t3"; ExecStart = "${serve}/bin/t3code-serve ${cfg.interface} ${cfg.package}/bin/t3";
Restart = "on-failure"; Restart = "on-failure";
RestartSec = "5"; RestartSec = "5";
EnvironmentFile = lib.mkIf (cfg.environmentFile != null) cfg.environmentFile;
}; };
environment = { environment = {