feat(nix): update claude-code package and dependencies

- Upgraded `claude-code` to version 2.1.34 and updated associated npm dependencies and hash values.
- Refactored `update.sh` to use `nix shell` instead of `nix-shell` for improved compatibility.
- Added musl-based `sharp` dependencies and adjusted sandbox requirements in `package.nix`.
This commit is contained in:
Harald Hoyer 2026-02-06 08:57:49 +01:00
parent 9b42e808d3
commit 4bc62866a8
4 changed files with 124 additions and 13 deletions

View file

@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell
#!nix-shell --pure --keep NIX_PATH -i bash --packages nodejs nix-update git cacert
#!/usr/bin/env nix
#!nix shell --ignore-environment .#cacert .#nodejs .#git .#nix-update .#nix .#gnused .#findutils .#bash --command bash
set -euo pipefail
@ -7,4 +7,9 @@ version=$(npm view @anthropic-ai/claude-code version)
# Update version and hashes
AUTHORIZED=1 NIXPKGS_ALLOW_UNFREE=1 nix-update claude-code --version="$version" --generate-lockfile
nix-update vscode-extensions.anthropic.claude-code --use-update-script --version "$version"
# nix-update can't update package-lock.json along with npmDepsHash
# TODO: Remove this workaround if nix-update can update package-lock.json along with npmDepsHash.
(nix-build --expr '((import ./.) { system = builtins.currentSystem; }).claude-code.npmDeps.overrideAttrs { outputHash = ""; outputHashAlgo = "sha256"; }' 2>&1 || true) \
| sed -nE '$s/ *got: *(sha256-[A-Za-z0-9+/=-]+).*/\1/p' \
| xargs -I{} sed -i 's|npmDepsHash = "sha256-[^"]*";|npmDepsHash = "{}";|' pkgs/by-name/cl/claude-code/package.nix