nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 buildNpmPackage,
5 fetchurl,
6 git,
7 installShellFiles,
8}:
9
10buildNpmPackage rec {
11 pname = "graphite-cli";
12 version = "1.7.16";
13
14 src = fetchurl {
15 url = "https://registry.npmjs.org/@withgraphite/graphite-cli/-/graphite-cli-${version}.tgz";
16 hash = "sha256-5/BOlO2sGfZwg6JGMxYeerA0zQEW1xom4ZSJEUXBO80=";
17 };
18
19 npmDepsHash = "sha256-wMs2je2FCZUpeKkxaKyeA5NN4+cR4lVNV1v7HDpUHG8=";
20
21 postPatch = ''
22 ln -s ${./package-lock.json} package-lock.json
23 '';
24
25 nativeBuildInputs = [
26 git
27 installShellFiles
28 ];
29
30 dontNpmBuild = true;
31
32 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
33 installShellCompletion --cmd gt \
34 --bash <($out/bin/gt completion) \
35 --fish <(GT_PAGER= $out/bin/gt fish) \
36 --zsh <(ZSH_NAME=zsh $out/bin/gt completion)
37 '';
38
39 passthru.updateScript = ./update.sh;
40
41 meta = {
42 changelog = "https://graphite.dev/docs/cli-changelog";
43 description = "CLI that makes creating stacked git changes fast & intuitive";
44 downloadPage = "https://www.npmjs.com/package/@withgraphite/graphite-cli";
45 homepage = "https://graphite.dev/docs/graphite-cli";
46 license = lib.licenses.unfree; # no license specified
47 mainProgram = "gt";
48 maintainers = with lib.maintainers; [ joshheinrichs-shopify ];
49 };
50}