nixcfg/overlays/unstable/claude-code/package.nix
Harald Hoyer 0d2b7bd942 feat(claude-code): update to version 2.0.50
- Bumped package version from 2.0.36 to 2.0.50.
- Updated package source hash and npmDeps hash to match the new version.
- Refreshed `package-lock.json` with the updated version.
2025-11-24 20:54:18 +01:00

59 lines
1.6 KiB
Nix

{
lib,
buildNpmPackage,
fetchzip,
writableTmpDirAsHomeHook,
versionCheckHook,
}:
buildNpmPackage (finalAttrs: {
pname = "claude-code";
version = "2.0.50";
src = fetchzip {
url = "https://registry.npmjs.org/@anthropic-ai/claude-code/-/claude-code-${finalAttrs.version}.tgz";
hash = "sha256-mZQkqeL/F/9u5esy1j1pUjcyzeaShREx+vMuvZ5Zrz8=";
};
npmDepsHash = "sha256-/5Qh99vAcTiFz6FrzJgm26RserqxVjLYqOOx5q5hkgc=";
postPatch = ''
cp ${./package-lock.json} package-lock.json
'';
dontNpmBuild = true;
env.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
# The DEV=true env var causes claude to crash with `TypeError: window.WebSocket is not a constructor`
postInstall = ''
wrapProgram $out/bin/claude \
--set DISABLE_AUTOUPDATER 1 \
--unset DEV
'';
doInstallCheck = true;
nativeInstallCheckInputs = [
writableTmpDirAsHomeHook
versionCheckHook
];
versionCheckKeepEnvironment = [ "HOME" ];
versionCheckProgramArg = "--version";
passthru.updateScript = ./update.sh;
meta = {
description = "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 = with lib.maintainers; [
malo
markus1189
omarjatoi
xiaoxiangmoe
];
mainProgram = "claude";
};
})