Add agent CLI wrappers to T3 Code packages

- Wire llm-agents into the flake
- Expose optional codex, Claude Code, and OpenCode paths in desktop and server wrappers
This commit is contained in:
2026-04-28 11:54:00 +03:00
parent d240f0f742
commit a5a063e1d0
4 changed files with 210 additions and 5 deletions
+16
View File
@@ -3,11 +3,17 @@
src,
stdenv,
bun,
codex ? null,
claudeCode ? null,
makeBinaryWrapper,
node-gyp,
nodejs,
opencode ? null,
python3,
writableTmpDirAsHomeHook,
withClaudeCode ? false,
withCodex ? false,
withOpencode ? false,
}: let
common = import ../common.nix {
inherit
@@ -23,6 +29,9 @@
pname = "t3code-server";
version = serverPackageJson.version;
in
assert lib.assertMsg (!withCodex || codex != null) "withCodex requires a codex package";
assert lib.assertMsg (!withClaudeCode || claudeCode != null) "withClaudeCode requires a claudeCode package";
assert lib.assertMsg (!withOpencode || opencode != null) "withOpencode requires an opencode package";
stdenv.mkDerivation (finalAttrs: {
inherit pname version;
inherit src;
@@ -107,6 +116,13 @@ in
cp -R --no-preserve=mode packages/shared "$out/libexec/t3code/packages/"
makeWrapper ${lib.getExe nodejs} "$out/bin/t3" \
${lib.optionalString withCodex ''
--prefix PATH : "${lib.makeBinPath [ codex ]}" \
''}${lib.optionalString withClaudeCode ''
--prefix PATH : "${lib.makeBinPath [ claudeCode ]}" \
''}${lib.optionalString withOpencode ''
--prefix PATH : "${lib.makeBinPath [ opencode ]}" \
''} \
--add-flags "$out/libexec/t3code/apps/server/dist/bin.mjs"
runHook postInstall