-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.nix
More file actions
56 lines (49 loc) · 1.37 KB
/
package.nix
File metadata and controls
56 lines (49 loc) · 1.37 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
{
lib,
stdenv,
autoPatchelfHook,
fetchurl,
}:
let
sources = lib.importJSON ./sources.json;
srcConfig =
sources.${stdenv.hostPlatform.system}
or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
in
stdenv.mkDerivation (finalAttrs: {
pname = "github-copilot-cli";
inherit (sources) version;
src = fetchurl {
url = "https://github.com/github/copilot-cli/releases/download/v${finalAttrs.version}/${srcConfig.name}.tar.gz";
inherit (srcConfig) hash;
};
nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [
autoPatchelfHook
];
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
stdenv.cc.cc.lib
];
sourceRoot = ".";
dontConfigure = true;
dontBuild = true;
dontStrip = true;
installPhase = ''
runHook preInstall
install -Dm755 copilot $out/bin/copilot
runHook postInstall
'';
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;
mainProgram = "copilot";
platforms = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
};
})