-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathpackage.nix
More file actions
87 lines (73 loc) · 2.77 KB
/
package.nix
File metadata and controls
87 lines (73 loc) · 2.77 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
{
lib,
flake,
fetchFromGitHub,
rustPlatform,
git,
versionCheckHook,
}:
rustPlatform.buildRustPackage rec {
pname = "claw-code";
version = "0-unstable-2026-05-11";
src = fetchFromGitHub {
owner = "ultraworkers";
repo = "claw-code";
rev = "8f55870dad9a49216561d7d6312f96769d42adc4";
hash = "sha256-9G+TMSIt4W/7VuMqtHssKP0i9hH0R/CYn6iA4hGV3no=";
};
sourceRoot = "source/rust";
# Upstream added a criterion dev-dependency to crates/api without
# regenerating Cargo.lock, so cargo can't resolve it from the vendored
# set. We don't run that crate's benches, so just drop the dep.
postPatch = ''
sed -i '/^criterion = /d' crates/api/Cargo.toml
'';
patches = [
# init::tests share a temp dir when SystemTime nanos collide between
# parallel test threads (observed on aarch64-darwin in the sandbox).
# Upstreamable; drop once merged.
./init-tests-unique-tmpdir.patch
];
cargoHash = "sha256-bZKghBTbKrhm2Jiyg2su1c9Jlx2HVrMQjOTK6cgEc00=";
cargoBuildFlags = [
"--package"
"rusty-claude-cli"
];
cargoTestFlags = cargoBuildFlags;
# Upstream's #[cfg(test)] block in rusty-claude-cli/src/main.rs is broken
# at this rev (ApiError::Api initializers missing the new suggested_action
# field). The release binary compiles fine, so skip cargo test until
# upstream catches up.
doCheck = false;
nativeCheckInputs = [ git ];
preCheck = ''
export HOME=$TMPDIR
'';
checkFlags = [
# broken upstream at this rev: tool allow-list assertions out of sync with implementation
"--skip=tests::rejects_unknown_allowed_tools"
"--skip=tests::build_runtime_plugin_state_discovers_mcp_tools_and_surfaces_pending_servers"
# integration harness expects scripted plugin fixtures not present in sandbox
"--skip=clean_env_cli_reaches_mock_anthropic_service_across_scripted_parity_scenarios"
];
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgramArg = "--version";
# Upstream has no tagged release yet; we track an unstable rev. The binary
# reports the Cargo workspace.package.version (e.g. 0.1.0), so compare
# against that rather than our `0-unstable-<date>` derivation version.
preVersionCheck = ''
version=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)
'';
passthru.category = "AI Coding Agents";
meta = {
description = "Claude Code rewrite CLI built from the official claw-code Rust workspace";
homepage = "https://github.com/ultraworkers/claw-code";
changelog = "https://github.com/ultraworkers/claw-code/releases";
license = lib.licenses.mit;
sourceProvenance = with lib.sourceTypes; [ fromSource ];
maintainers = with flake.lib.maintainers; [ smdex ];
mainProgram = "claw";
platforms = lib.platforms.unix;
};
}