about summary refs log tree commit diff
diff options
context:
space:
mode:
authorzowoq <59103226+zowoq@users.noreply.github.com>2020-02-04 12:15:27 +1000
committerzowoq <59103226+zowoq@users.noreply.github.com>2020-02-04 13:53:56 +1000
commiteb957383b772039deb6f3f7e5968ea7134c24710 (patch)
treefb257d94a0318ec6cbd4c4a3afe81201e5bd6c1f
parent3dc9c1b88528888e21e33a106e07495f83599435 (diff)
downloadnixlib-eb957383b772039deb6f3f7e5968ea7134c24710.tar
nixlib-eb957383b772039deb6f3f7e5968ea7134c24710.tar.gz
nixlib-eb957383b772039deb6f3f7e5968ea7134c24710.tar.bz2
nixlib-eb957383b772039deb6f3f7e5968ea7134c24710.tar.lz
nixlib-eb957383b772039deb6f3f7e5968ea7134c24710.tar.xz
nixlib-eb957383b772039deb6f3f7e5968ea7134c24710.tar.zst
nixlib-eb957383b772039deb6f3f7e5968ea7134c24710.zip
gitAndTools.gh: init at 0.5.3
-rw-r--r--pkgs/applications/version-management/git-and-tools/default.nix2
-rw-r--r--pkgs/applications/version-management/git-and-tools/gh/default.nix36
2 files changed, 38 insertions, 0 deletions
diff --git a/pkgs/applications/version-management/git-and-tools/default.nix b/pkgs/applications/version-management/git-and-tools/default.nix
index 3682717f314d..fc3af0a933bb 100644
--- a/pkgs/applications/version-management/git-and-tools/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/default.nix
@@ -28,6 +28,8 @@ let
 
   diff-so-fancy = callPackage ./diff-so-fancy { };
 
+  gh = callPackage ./gh { };
+
   ghq = callPackage ./ghq { };
 
   git = appendToName "minimal" gitBase;
diff --git a/pkgs/applications/version-management/git-and-tools/gh/default.nix b/pkgs/applications/version-management/git-and-tools/gh/default.nix
new file mode 100644
index 000000000000..02f830a3f07e
--- /dev/null
+++ b/pkgs/applications/version-management/git-and-tools/gh/default.nix
@@ -0,0 +1,36 @@
+{ lib, fetchFromGitHub, buildGoModule, installShellFiles }:
+
+buildGoModule rec {
+  pname = "gh";
+  version = "0.5.3";
+
+  src = fetchFromGitHub {
+    owner = "cli";
+    repo = "cli";
+    rev = "v${version}";
+    sha256 = "033y9bwdaj8735nmj22k8lrgkgimji7hyly9i4jyp11iaa7cgd7a";
+  };
+
+  modSha256 = "0ina3m2ixkkz2fws6ifwy34pmp6kn5s3j7w40alz6vmybn2smy1h";
+
+  buildFlagsArray = [
+    "-ldflags=-X github.com/cli/cli/command.Version=${version}"
+  ];
+
+  subPackages = [ "cmd/gh" ];
+
+  nativeBuildInputs = [ installShellFiles ];
+  postInstall = ''
+    for shell in bash fish zsh; do
+      $out/bin/gh completion -s $shell > gh.$shell
+      installShellCompletion gh.$shell
+    done
+  '';
+
+  meta = with lib; {
+    description = "GitHub CLI tool";
+    homepage = "https://github.com/cli/cli";
+    license = licenses.mit;
+    maintainers = with maintainers; [ zowoq ];
+  };
+}