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>
This commit is contained in:
m3ta-chironandClaude Opus 5.5 committed 2026-11-05 07:48:18 +01:00
1 parent 2a36d43d9d
commit 2187d9263d
2 files changed
+17

No files matched your search

+15
View File
@@ -52,6 +52,20 @@ in {
defaultText = lib.literalExpression "pkgs.llm-agents.t3code";
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 {
@@ -75,6 +89,7 @@ in {
ExecStart = "${serve}/bin/t3code-serve ${cfg.interface} ${cfg.package}/bin/t3";
Restart = "on-failure";
RestartSec = "5";
EnvironmentFile = lib.mkIf (cfg.environmentFile != null) cfg.environmentFile;
};
environment = {