feat(claude-code): update to version 2.0.1

- Updated `@anthropic-ai/claude-code` package to version 2.0.1.
- Adjusted hashes in `package.nix` and `package-lock.json` for the new version.
- Added `--unset DEV` flag in `postInstall` script to prevent crashes.
This commit is contained in:
Harald Hoyer 2025-10-02 08:34:49 +02:00
parent 3e596d7ec1
commit 26628cbe12
2 changed files with 11 additions and 8 deletions

View file

@ -6,13 +6,13 @@
"packages": { "packages": {
"": { "": {
"dependencies": { "dependencies": {
"@anthropic-ai/claude-code": "^1.0.128" "@anthropic-ai/claude-code": "^1.0.109"
} }
}, },
"node_modules/@anthropic-ai/claude-code": { "node_modules/@anthropic-ai/claude-code": {
"version": "1.0.128", "version": "1.0.109",
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-code/-/claude-code-1.0.128.tgz", "resolved": "https://registry.npmjs.org/@anthropic-ai/claude-code/-/claude-code-1.0.109.tgz",
"integrity": "sha512-uUg5cFMJfeQetQzFw76Vpbro6DAXst2Lpu8aoZWRFSoQVYu5ZSAnbBoxaWmW/IgnHSqIIvtMwzCoqmcA9j9rNQ==", "integrity": "sha512-gjj76f/+M5KfI+ORA9VNVJgR7s8eyur66XCWIIO66q4poNWcszxidXo+TDTqokLLwuNV+qFGx4JkK/PDmtwqMA==",
"license": "SEE LICENSE IN README.md", "license": "SEE LICENSE IN README.md",
"bin": { "bin": {
"claude": "cli.js" "claude": "cli.js"

View file

@ -7,16 +7,16 @@
buildNpmPackage rec { buildNpmPackage rec {
pname = "claude-code"; pname = "claude-code";
version = "1.0.128"; version = "2.0.1";
nodejs = nodejs_20; # required for sandboxed Nix builds on Darwin nodejs = nodejs_20; # required for sandboxed Nix builds on Darwin
src = fetchzip { src = fetchzip {
url = "https://registry.npmjs.org/@anthropic-ai/claude-code/-/claude-code-${version}.tgz"; url = "https://registry.npmjs.org/@anthropic-ai/claude-code/-/claude-code-${version}.tgz";
hash = "sha256-dzLGcCgje3FMMS+Ptmxd2JK08y7z9rI0ak5l3Bv1MUk="; hash = "sha256-LUbDPFa0lY74MBU4hvmYVntt6hVZy6UUZFN0iB4Eno8=";
}; };
npmDepsHash = "sha256-Oba5Wx3HdrXaYKklm9LrKXVdvBeo05CgGy4zzo2B9T0="; npmDepsHash = "sha256-jpvy7b4A+E5iI7Y7kYnwH51BZAQGVXKaf3lQjI9e3OM=";
postPatch = '' postPatch = ''
cp ${./package-lock.json} package-lock.json cp ${./package-lock.json} package-lock.json
@ -28,9 +28,11 @@ buildNpmPackage rec {
# `claude-code` tries to auto-update by default, this disables that functionality. # `claude-code` tries to auto-update by default, this disables that functionality.
# https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/overview#environment-variables # https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/overview#environment-variables
# The DEV=true env var causes claude to crash with `TypeError: window.WebSocket is not a constructor`
postInstall = '' postInstall = ''
wrapProgram $out/bin/claude \ wrapProgram $out/bin/claude \
--set DISABLE_AUTOUPDATER 1 --set DISABLE_AUTOUPDATER 1 \
--unset DEV
''; '';
passthru.updateScript = ./update.sh; passthru.updateScript = ./update.sh;
@ -42,6 +44,7 @@ buildNpmPackage rec {
license = lib.licenses.unfree; license = lib.licenses.unfree;
maintainers = with lib.maintainers; [ maintainers = with lib.maintainers; [
malo malo
markus1189
omarjatoi omarjatoi
]; ];
mainProgram = "claude"; mainProgram = "claude";