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