Files
nixpkgs/pkgs/by-name/gi/github-copilot-cli/package.nix
2026-01-01 02:21:16 +00:00

52 lines
1.3 KiB
Nix

{
lib,
stdenv,
fetchzip,
nodejs,
makeBinaryWrapper,
versionCheckHook,
nix-update-script,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "github-copilot-cli";
version = "0.0.373";
src = fetchzip {
url = "https://registry.npmjs.org/@github/copilot/-/copilot-${finalAttrs.version}.tgz";
hash = "sha256-Mo6RdDEXaLzWCyKPO1Oalc9hO8/gW6x01tpHiFVGiWM=";
};
nativeBuildInputs = [ makeBinaryWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/lib/node_modules/@github/copilot
cp -r . $out/lib/node_modules/@github/copilot
mkdir -p $out/bin
makeBinaryWrapper ${nodejs}/bin/node $out/bin/copilot \
--add-flags "$out/lib/node_modules/@github/copilot/index.js"
runHook postInstall
'';
nativeInstallCheckInputs = [ versionCheckHook ];
doInstallCheck = true;
passthru.updateScript = nix-update-script { };
meta = {
description = "GitHub Copilot CLI brings the power of Copilot coding agent directly to your terminal";
homepage = "https://github.com/github/copilot-cli";
changelog = "https://github.com/github/copilot-cli/releases/tag/v${finalAttrs.version}";
downloadPage = "https://www.npmjs.com/package/@github/copilot";
license = lib.licenses.unfree;
maintainers = with lib.maintainers; [
dbreyfogle
];
mainProgram = "copilot";
};
})