Repository navigation
Expand file tree
/
Copy pathdefault.nix
More file actions
89 lines (77 loc) · 2.43 KB
/
Copy pathdefault.nix
File metadata and controls
89 lines (77 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# qwen-code (Qwen3-Coder CLI) pinned for the `agentix.agents.qwen_code` sandbox
# integration. `agentix build` discovers this file through the `agentix.nix`
# entry point and places `qwen` on `/nix/runtime/bin`.
#
# Lifted from numtide/llm-agents.nix (packages/qwen-code, v0.16.2) and adapted
# to plain nixpkgs: the Darwin-only build inputs and the network-touching
# versionCheckHook are dropped; the buildPhase/installPhase are kept as-is.
# `git` and `ripgrep` are joined into the runtime closure so the CLI can shell
# out to them inside the sandbox.
{ pkgs }:
let
qwen = pkgs.buildNpmPackage (finalAttrs: {
npmDepsFetcherVersion = 2;
pname = "qwen-code";
version = "0.16.2";
src = pkgs.fetchFromGitHub {
owner = "QwenLM";
repo = "qwen-code";
tag = "v${finalAttrs.version}";
hash = "sha256-0JUwrIvuJV7m2Y2yemZfr9K3R6KX1fzrzTUTiBEArtQ=";
};
# npmDepsHash recomputed against Agentix's pinned nixpkgs (the upstream
# llm-agents.nix value resolves to a different hash here).
npmDepsHash = "sha256-Ep7/A+kbpTZHAHo30bXuPbHLcwDYb49v50B7D8ud1VA=";
makeCacheWritable = true;
nativeBuildInputs = [
pkgs.pkg-config
pkgs.git
];
buildInputs = [
pkgs.ripgrep
pkgs.glib
pkgs.libsecret
];
buildPhase = ''
runHook preBuild
npm run generate
for ws in \
packages/web-templates \
packages/channels/base \
packages/channels/telegram \
packages/channels/weixin \
packages/channels/dingtalk
do
npm run build --workspace=$ws
done
npm run bundle
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/share/qwen-code
cp -r dist/* $out/share/qwen-code/
npm prune --production
cp -r node_modules $out/share/qwen-code/
find $out/share/qwen-code/node_modules -type l -delete || true
patchShebangs $out/share/qwen-code
ln -s $out/share/qwen-code/cli.js $out/bin/qwen
runHook postInstall
'';
meta = {
description = "qwen-code — command-line AI workflow tool for Qwen3-Coder models";
homepage = "https://github.com/QwenLM/qwen-code";
license = pkgs.lib.licenses.asl20;
mainProgram = "qwen";
platforms = [ "x86_64-linux" "aarch64-linux" ];
};
});
in
pkgs.symlinkJoin {
name = "agentix-agent-qwen-code-sys";
paths = [
qwen
pkgs.git
pkgs.ripgrep
];
}