nixpkgs/pkgs/applications/editors/vscode/extensions/anthropic.claude-code/default.nix

67 lines
1.9 KiB
Nix

{
lib,
stdenv,
stdenvNoCC,
autoPatchelfHook,
alsa-lib,
testers,
vscode-utils,
}:
vscode-utils.buildVscodeMarketplaceExtension (finalAttrs: {
nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ];
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
(lib.getLib stdenv.cc.cc)
alsa-lib
];
mktplcRef =
let
sources = {
"x86_64-linux" = {
arch = "linux-x64";
hash = "sha256-D9fCOrdx2lzkafxPJENKc8tZnO+03c7CR3w/3LAQOa8=";
};
"aarch64-linux" = {
arch = "linux-arm64";
hash = "sha256-E4VUFvsyp0sJ1I0dIRAgIfa09zyvZHzZvKCMq5H9sig=";
};
"x86_64-darwin" = {
arch = "darwin-x64";
hash = "sha256-4k71rBIHOjmC9iJvaZlD6t36jqM6fclqM/yTWSoYrvs=";
};
"aarch64-darwin" = {
arch = "darwin-arm64";
hash = "sha256-08QK3qOhE6f+LaSL2qVZgecfO6/Lqw3WVCD1wABluho=";
};
};
in
{
name = "claude-code";
publisher = "anthropic";
version = "2.1.152";
}
// sources.${stdenvNoCC.hostPlatform.system}
or (throw "Unsupported system ${stdenvNoCC.hostPlatform.system}");
passthru.tests.bundled-claude-runs = testers.testVersion {
package = finalAttrs.finalPackage;
command = "${finalAttrs.finalPackage}/share/vscode/extensions/anthropic.claude-code/resources/native-binary/claude --version";
};
meta = {
description = "Harness the power of Claude Code without leaving your IDE";
homepage = "https://docs.anthropic.com/s/claude-code";
downloadPage = "https://marketplace.visualstudio.com/items?itemName=anthropic.claude-code";
license = lib.licenses.unfree;
sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
maintainers = with lib.maintainers; [ xiaoxiangmoe ];
platforms = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
};
})