- Bumped version of `claude-code` from 0.2.99 to 0.2.106. - Updated dependencies, hashes, and added Node.js 20 support. - Ensures compatibility with the latest release and runtime environment.
47 lines
1.2 KiB
Nix
47 lines
1.2 KiB
Nix
{
|
|
lib,
|
|
buildNpmPackage,
|
|
fetchzip,
|
|
nodejs_20,
|
|
}:
|
|
|
|
buildNpmPackage rec {
|
|
pname = "claude-code";
|
|
version = "0.2.106";
|
|
|
|
nodejs = nodejs_20;
|
|
|
|
src = fetchzip {
|
|
url = "https://registry.npmjs.org/@anthropic-ai/claude-code/-/claude-code-${version}.tgz";
|
|
hash = "sha256-hS/aPB4hL1+jeJjIu+ztS2TVLO4lL7IKhBTMXlRO58Y=";
|
|
};
|
|
|
|
npmDepsHash = "sha256-HZ3d04tLeZkSLACIu79K5QIYpkYNcSyvp07OXIgFdss=";
|
|
|
|
postPatch = ''
|
|
cp ${./package-lock.json} package-lock.json
|
|
'';
|
|
|
|
dontNpmBuild = true;
|
|
|
|
AUTHORIZED = "1";
|
|
|
|
# `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
|
|
postInstall = ''
|
|
wrapProgram $out/bin/claude \
|
|
--set DISABLE_AUTOUPDATER 1
|
|
'';
|
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
meta = {
|
|
description = "An agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster";
|
|
homepage = "https://github.com/anthropics/claude-code";
|
|
downloadPage = "https://www.npmjs.com/package/@anthropic-ai/claude-code";
|
|
license = lib.licenses.unfree;
|
|
maintainers = [ lib.maintainers.malo ];
|
|
mainProgram = "claude";
|
|
};
|
|
}
|