-
Notifications
You must be signed in to change notification settings - Fork 131
Expand file tree
/
Copy pathpackage.nix
More file actions
72 lines (60 loc) · 1.86 KB
/
package.nix
File metadata and controls
72 lines (60 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{
lib,
stdenv,
fetchurl,
makeWrapper,
wrapBuddy,
cacert,
nodejs_24,
ripgrep,
bash,
versionCheckHook,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "copilot-cli";
version = "1.0.45";
src = fetchurl {
url = "https://registry.npmjs.org/@github/copilot/-/copilot-${finalAttrs.version}.tgz";
hash = "sha256-4OpnzlfyGOQFcIADJOLtGEsfNqgO10UXdZyKBIzLb6Y=";
};
nativeBuildInputs = [ makeWrapper ] ++ lib.optionals stdenv.hostPlatform.isLinux [ wrapBuddy ];
# Bundled mxc-bin/{x64,arm64}/lxc-exec dlopen libgcc_s.so.1 at runtime.
runtimeDependencies = lib.optionals stdenv.hostPlatform.isLinux [ stdenv.cc.cc.lib ];
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/lib/${finalAttrs.pname}
cp -r . $out/lib/${finalAttrs.pname}
mkdir -p $out/bin
makeWrapper ${nodejs_24}/bin/node $out/bin/copilot \
--add-flags "$out/lib/${finalAttrs.pname}/index.js" \
--set SSL_CERT_DIR "${cacert}/etc/ssl/certs" \
--set-default COPILOT_AUTO_UPDATE false \
--set-default USE_BUILTIN_RIPGREP false \
--prefix PATH : ${
lib.makeBinPath [
ripgrep
bash
]
}
runHook postInstall
'';
doInstallCheck = true;
nativeInstallCheckInputs = [ versionCheckHook ];
versionCheckProgramArg = [ "--version" ];
passthru.category = "AI Coding Agents";
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}";
license = lib.licenses.unfree;
sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
platforms = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
mainProgram = "copilot";
};
})