-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpackage.nix
More file actions
40 lines (34 loc) · 880 Bytes
/
package.nix
File metadata and controls
40 lines (34 loc) · 880 Bytes
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
{
stdenv,
fetchurl,
nodejs,
makeWrapper
}:
let
versions = builtins.fromJSON (builtins.readFile ./versions.json);
pname = "github-copilot-cli";
version = versions.version;
in
stdenv.mkDerivation rec {
inherit pname version;
src = fetchurl {
url = "https://registry.npmjs.org/@github/copilot/-/copilot-${version}.tgz";
sha256 = versions.sha256;
};
nativeBuildInputs = [ makeWrapper ];
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/lib/node_modules/@github/copilot
cp -r . $out/lib/node_modules/@github/copilot
mkdir -p $out/bin
makeWrapper ${nodejs}/bin/node $out/bin/copilot \
--add-flags "$out/lib/node_modules/@github/copilot/index.js"
runHook postInstall
'';
meta = {
description = "Github Copilot CLI";
homepage = "https://github.com";
mainProgram = "copilot";
};
}