nixcfg/overlays/unstable/claude-code/package.nix
Harald Hoyer 79a461e88a feat(package): update Claude Code package configuration
- Adjusted formatting for consistent style in package.nix.
- Added NODE_OPTIONS to increase memory limit for Node.js processes.
This improves stability and handles larger workloads efficiently.
2025-05-27 15:36:21 +02:00

44 lines
1.2 KiB
Nix

{ lib
, buildNpmPackage
, fetchzip
,
}:
buildNpmPackage rec {
pname = "claude-code";
version = "1.0.3";
src = fetchzip {
url = "https://registry.npmjs.org/@anthropic-ai/claude-code/-/claude-code-${version}.tgz";
hash = "sha256-LjDxVv6KSTuRZhCHztvf81E5DQbkqs8cbrnbbGkCeQU=";
};
npmDepsHash = "sha256-muMukVEj6uXkupSoyp41FihsLth0ENgfzBlD5CwlE2w=";
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 \
--set NODE_OPTIONS "--max_old_space_size=8192"
'';
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";
};
}