nixcfg/overlays/unstable/claude-code/package.nix
Harald Hoyer d03615aee1 feat: upgrade claude-code to version 0.2.114
Updated the claude-code package to version 0.2.114 and its associated hash in the package definition. Removed nodejs_20 references and related dependencies as part of cleanup.
2025-05-15 08:52:43 +02:00

44 lines
1.2 KiB
Nix

{
lib,
buildNpmPackage,
fetchzip,
}:
buildNpmPackage rec {
pname = "claude-code";
version = "0.2.114";
src = fetchzip {
url = "https://registry.npmjs.org/@anthropic-ai/claude-code/-/claude-code-${version}.tgz";
hash = "sha256-el6pRQaMczBTrpC+LA2i60BjEWe50WTZ1vogsCGi/y0=";
};
npmDepsHash = "sha256-291F5Tq+JhlVETy1X4rMDgWlt/0//bjY+0WPUyQk3Sg=";
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";
};
}