{ lib, pkgs, runCommand, claude-code }: let version = "2.0.76"; src = pkgs.fetchzip { url = "https://registry.npmjs.org/@anthropic-ai/claude-code/-/claude-code-${version}.tgz"; hash = "sha256-46IqiGJZrZM4vVcanZj/vY4uxFH3/4LxNA+Qb6iIHDk="; }; # Create a modified source with our package-lock.json srcWithLock = runCommand "claude-code-src-${version}" {} '' cp -r ${src} $out chmod -R +w $out cp ${./package-lock.json} $out/package-lock.json ''; in (claude-code.override {}).overrideAttrs (oldAttrs: { inherit version; src = srcWithLock; npmDeps = pkgs.fetchNpmDeps { src = srcWithLock; hash = "sha256-xSNyYImDpsW6AltA7d0ayMsfVaBcnyPIQOg/Ea2cGNk="; }; # Remove the old postPatch since srcWithLock already includes package-lock.json postPatch = ""; })