31 lines
807 B
Nix
31 lines
807 B
Nix
{ lib, pkgs, runCommand, claude-code }:
|
|
|
|
let
|
|
version = "2.0.55";
|
|
|
|
src = pkgs.fetchzip {
|
|
url = "https://registry.npmjs.org/@anthropic-ai/claude-code/-/claude-code-${version}.tgz";
|
|
hash = "sha256-wsjOkNxuBLMYprjaZQyUZHiqWl8UG7cZ1njkyKZpRYg=";
|
|
};
|
|
|
|
# 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-cFvPoCmh3XpJe/5LPZizfBz6F6xAPYnBNimrK4+VbPw=";
|
|
};
|
|
|
|
# Remove the old postPatch since srcWithLock already includes package-lock.json
|
|
postPatch = "";
|
|
})
|