feat(claude-code): update to version 2.0.25
- Updated `@anthropic-ai/claude-code` package to version 2.0.25. - Revised hashes in `package.nix` and `package-lock.json` for the new release. - Added `writableTmpDirAsHomeHook` and `versionCheckHook` for install checks. - Refined update script to use `--generate-lockfile` and handle unfree dependencies.
This commit is contained in:
parent
83fea90a5e
commit
944d6bf040
3 changed files with 25 additions and 29 deletions
14
overlays/unstable/claude-code/package-lock.json
generated
14
overlays/unstable/claude-code/package-lock.json
generated
|
|
@ -1,18 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "claude-code",
|
"name": "@anthropic-ai/claude-code",
|
||||||
"version": "1.0.17",
|
"version": "2.0.25",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"dependencies": {
|
"name": "@anthropic-ai/claude-code",
|
||||||
"@anthropic-ai/claude-code": "^2.0.21"
|
"version": "2.0.25",
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@anthropic-ai/claude-code": {
|
|
||||||
"version": "2.0.21",
|
|
||||||
"resolved": "https://registry.npmjs.org/@anthropic-ai/claude-code/-/claude-code-2.0.21.tgz",
|
|
||||||
"integrity": "sha512-02NcxPVjioLjo4/djzIt4aAYkYqnZsHgdzgMexLURYLR9q1+B+OLkKddKwOHL8fas3WnUGV1oyybu73BfHqQ4A==",
|
|
||||||
"license": "SEE LICENSE IN README.md",
|
"license": "SEE LICENSE IN README.md",
|
||||||
"bin": {
|
"bin": {
|
||||||
"claude": "cli.js"
|
"claude": "cli.js"
|
||||||
|
|
|
||||||
|
|
@ -2,21 +2,19 @@
|
||||||
lib,
|
lib,
|
||||||
buildNpmPackage,
|
buildNpmPackage,
|
||||||
fetchzip,
|
fetchzip,
|
||||||
nodejs_20,
|
writableTmpDirAsHomeHook,
|
||||||
|
versionCheckHook,
|
||||||
}:
|
}:
|
||||||
|
buildNpmPackage (finalAttrs: {
|
||||||
buildNpmPackage rec {
|
|
||||||
pname = "claude-code";
|
pname = "claude-code";
|
||||||
version = "2.0.21";
|
version = "2.0.25";
|
||||||
|
|
||||||
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-${finalAttrs.version}.tgz";
|
||||||
hash = "sha256-sX9btcy9uEHloAQNvCJFhwh0U/W14NWz2FjkdLXm1Q0=";
|
hash = "sha256-ix/JSPBLnvCPtyqJ6beAaOpuimphpkrkIw5HCdeeGkM=";
|
||||||
};
|
};
|
||||||
|
|
||||||
npmDepsHash = "sha256-LBc1M3FwWg6SP+p7GQ00LQfiYyhmU1OzsohDu6rukjA=";
|
npmDepsHash = "sha256-NjmCmOwepKaSZ+vji0sUlZ1nSkcG02kNokGe37YYtX0=";
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
cp ${./package-lock.json} package-lock.json
|
cp ${./package-lock.json} package-lock.json
|
||||||
|
|
@ -24,7 +22,7 @@ buildNpmPackage rec {
|
||||||
|
|
||||||
dontNpmBuild = true;
|
dontNpmBuild = true;
|
||||||
|
|
||||||
AUTHORIZED = "1";
|
env.AUTHORIZED = "1";
|
||||||
|
|
||||||
# `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
|
||||||
|
|
@ -35,6 +33,14 @@ buildNpmPackage rec {
|
||||||
--unset DEV
|
--unset DEV
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
doInstallCheck = true;
|
||||||
|
nativeInstallCheckInputs = [
|
||||||
|
writableTmpDirAsHomeHook
|
||||||
|
versionCheckHook
|
||||||
|
];
|
||||||
|
versionCheckKeepEnvironment = [ "HOME" ];
|
||||||
|
versionCheckProgramArg = "--version";
|
||||||
|
|
||||||
passthru.updateScript = ./update.sh;
|
passthru.updateScript = ./update.sh;
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
|
|
@ -46,7 +52,8 @@ buildNpmPackage rec {
|
||||||
malo
|
malo
|
||||||
markus1189
|
markus1189
|
||||||
omarjatoi
|
omarjatoi
|
||||||
|
xiaoxiangmoe
|
||||||
];
|
];
|
||||||
mainProgram = "claude";
|
mainProgram = "claude";
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,10 @@
|
||||||
#!/usr/bin/env nix-shell
|
#!/usr/bin/env nix-shell
|
||||||
#!nix-shell -i bash -p nodePackages.npm nix-update
|
#!nix-shell --pure --keep NIX_PATH -i bash --packages nodejs nix-update git
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
version=$(npm view @anthropic-ai/claude-code version)
|
version=$(npm view @anthropic-ai/claude-code version)
|
||||||
|
|
||||||
# Generate updated lock file
|
|
||||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
|
||||||
npm i --package-lock-only @anthropic-ai/claude-code@"$version"
|
|
||||||
rm -f package.json
|
|
||||||
|
|
||||||
# Update version and hashes
|
# Update version and hashes
|
||||||
cd -
|
AUTHORIZED=1 NIXPKGS_ALLOW_UNFREE=1 nix-update claude-code --version="$version" --generate-lockfile
|
||||||
nix-update claude-code --version "$version"
|
nix-update vscode-extensions.anthropic.claude-code --use-update-script --version "$version"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue