about summary refs log tree commit diff
path: root/pkgs/applications/version-management/gg
diff options
context:
space:
mode:
authorAndersonTorres <torres.anderson.85@protonmail.com>2022-12-19 08:46:57 -0300
committerAndersonTorres <torres.anderson.85@protonmail.com>2022-12-19 15:05:22 -0300
commitd994dabacef6a7e13a41d144cd6d800f8e21a11f (patch)
tree04bf3d99d27800b95686feef4000e7794e2df375 /pkgs/applications/version-management/gg
parentb10a520017ac319c1e57b07742efd2bcc918d160 (diff)
treewide: remove git-and-tools directory
We do not use a "plugin system" for Git addons anymore, and therefore this
directory is no longer useful. Indeed that directory is way more confusing,
given that it includes more than mere Git addons, going from Bitbucket server
command-line tools to complete rewrites of Git in exotic programming languages.

Also, without this directory, the mental load of decision-making reduces a lot.
When anyone is interested in including a new git-related tool, just put it into
pkgs/applications/version-management, without apologies.
Diffstat (limited to 'pkgs/applications/version-management/gg')
-rw-r--r--pkgs/applications/version-management/gg/default.nix64
1 files changed, 64 insertions, 0 deletions
diff --git a/pkgs/applications/version-management/gg/default.nix b/pkgs/applications/version-management/gg/default.nix
new file mode 100644
index 0000000000000..032c461a74ce8
--- /dev/null
+++ b/pkgs/applications/version-management/gg/default.nix
@@ -0,0 +1,64 @@
+{ lib
+, buildGoModule
+, fetchFromGitHub
+, installShellFiles
+, makeWrapper
+, bash
+, coreutils
+, git
+, pandoc
+}:
+
+let
+  version = "1.3.0";
+  commit = "5bfe79b3632f15c442e8dc51ec206ab76354487f";
+in buildGoModule {
+  pname = "gg-scm";
+  inherit version;
+
+  src = fetchFromGitHub {
+    owner = "gg-scm";
+    repo = "gg";
+    rev = "v${version}";
+    sha256 = "e628aeddb94d2470de860df09ef65499f8c5493fb336bf3df8502842ee02487f";
+  };
+  postPatch = ''
+    substituteInPlace cmd/gg/editor_unix.go \
+      --replace /bin/sh ${bash}/bin/sh
+  '';
+  subPackages = [ "cmd/gg" ];
+  ldflags = [
+    "-s" "-w"
+    "-X" "main.versionInfo=${version}"
+    "-X" "main.buildCommit=${commit}"
+  ];
+
+  vendorSha256 = "214dc073dad7b323ea449acf24c5b578d573432eeaa1506cf5761a2d7f5ce405";
+
+  nativeBuildInputs = [ pandoc installShellFiles makeWrapper ];
+  checkInputs = [ bash coreutils git ];
+  buildInputs = [ bash git ];
+
+  postInstall = ''
+    wrapProgram $out/bin/gg --suffix PATH : ${git}/bin
+    pandoc --standalone --to man misc/gg.1.md -o misc/gg.1
+    installManPage misc/gg.1
+    installShellCompletion --cmd gg \
+      --bash misc/gg.bash \
+      --zsh misc/_gg.zsh
+  '';
+
+  meta = with lib; {
+    mainProgram = "gg";
+    description = "Git with less typing";
+    longDescription = ''
+      gg is an alternative command-line interface for Git heavily inspired by Mercurial.
+      It's designed for less typing in common workflows,
+      making Git easier to use for both novices and advanced users alike.
+    '';
+    homepage = "https://gg-scm.io/";
+    changelog = "https://github.com/gg-scm/gg/blob/v${version}/CHANGELOG.md";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ zombiezen ];
+  };
+}