about summary refs log tree commit diff
path: root/third_party/git-bug/default.nix
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2020-06-14T21·43+0100
committertazjin <mail@tazj.in>2020-06-14T22·27+0000
commit69fe278315615f944648542b3cab4f26c5165c21 (patch)
treeccbf72f2477aed1007dff8f5008e294c0f32311b /third_party/git-bug/default.nix
parent9757e93b23105e13e132593f14ae493b8976e95d (diff)
feat(3p/git-bug): Add git-bug derivation at unstable-20200614 r/959
This builds git-bug, a distributed issue tracker that uses git as its
data store.

It also installs its man pages and shell completions. It is
recommended that users add git-bug to their system closure for these
extras to work, as they will not be picked up by the dispatch script.

Change-Id: I1595368e61b0bae8a9497abd023085cb90a521a6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/345
Reviewed-by: lukegb <lukegb@tvl.fyi>
Diffstat (limited to 'third_party/git-bug/default.nix')
-rw-r--r--third_party/git-bug/default.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/third_party/git-bug/default.nix b/third_party/git-bug/default.nix
new file mode 100644
index 000000000000..e9ea60b67224
--- /dev/null
+++ b/third_party/git-bug/default.nix
@@ -0,0 +1,36 @@
+{ pkgs, lib, ... }:
+
+pkgs.buildGoModule {
+  pname = "git-bug";
+  version = "unstable-20200614";
+  vendorSha256 = "1b8m9b05jbwx336fyv8sxcki00vpinyl95nyhygi7yj0as7x978x";
+
+  nativeBuildInputs = [ pkgs.installShellFiles ];
+
+  src = pkgs.fetchFromGitHub {
+    owner = "MichaelMure";
+    repo = "git-bug";
+    rev = "6352d6aa2338f47cd8b60631dec5f4161d9d92ec";
+    sha256 = "1cwsl3n6w8gfzx4j9sb5f7vdnxpnyhsq1lbf4f90ivmshjc2i8fw";
+  };
+
+  # git-bug builds 3 binaries (git-bug itself, misc and doc). The two
+  # additional binaries are used to generate man pages and shell
+  # completions. However, the generated things are already checked in.
+  postBuild = ''
+    rm $GOPATH/bin/misc $GOPATH/bin/doc
+  '';
+
+  postInstall = ''
+    installManPage doc/man/*
+    installShellCompletion --bash misc/bash_completion/git-bug
+    installShellCompletion --fish misc/fish_completion/git-bug
+    installShellCompletion --zsh misc/zsh_completion/git-bug
+  '';
+
+  meta = with lib; {
+    description = "Distributed, offline-first bug tracker embedded in git";
+    homepage = "https://github.com/MichaelMure/git-bug";
+    license = licenses.gpl3;
+  };
+}