about summary refs log tree commit diff
path: root/pkgs/development/tools/buf/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/tools/buf/default.nix')
-rw-r--r--pkgs/development/tools/buf/default.nix28
1 files changed, 22 insertions, 6 deletions
diff --git a/pkgs/development/tools/buf/default.nix b/pkgs/development/tools/buf/default.nix
index 1a14e78af318a..60d8d8f58b8cb 100644
--- a/pkgs/development/tools/buf/default.nix
+++ b/pkgs/development/tools/buf/default.nix
@@ -5,19 +5,21 @@
 , git
 , testVersion
 , buf
+, installShellFiles
 }:
 
 buildGoModule rec {
   pname = "buf";
-  version = "1.0.0-rc10";
+  version = "1.0.0";
 
   src = fetchFromGitHub {
     owner = "bufbuild";
     repo = pname;
     rev = "v${version}";
-    sha256 = "sha256-N6BZ6HDDQ0m41BHGdKOONUjdIBDnPJOpN3eJMcsXYi8=";
+    sha256 = "sha256-jJaob2eaozMFRsXwW6ulgM5De3UmpLZddTHwq6PnaeE=";
   };
-  vendorSha256 = "sha256-VPS5nRsAssgKSQ6DMtB6+MkMrpIY5+JEvOpaMZ3IWV8=";
+
+  vendorSha256 = "sha256-wPnrkfv6pJB6tkZo2oeMbWHbF9njGh1ZEWu8tkHDhGo=";
 
   patches = [
     # Skip a test that requires networking to be available to work.
@@ -26,12 +28,15 @@ buildGoModule rec {
     ./skip_test_requiring_dotgit.patch
   ];
 
-  nativeBuildInputs = [ protobuf ];
-  # Required for TestGitCloner
-  checkInputs = [ git ];
+  nativeBuildInputs = [ installShellFiles ];
 
   ldflags = [ "-s" "-w" ];
 
+  checkInputs = [
+    git # Required for TestGitCloner
+    protobuf # Required for buftesting.GetProtocFilePaths
+  ];
+
   preCheck = ''
     # The tests need access to some of the built utilities
     export PATH="$PATH:$GOPATH/bin"
@@ -42,6 +47,7 @@ buildGoModule rec {
   installPhase = ''
     runHook preInstall
 
+    # Binaries
     mkdir -p "$out/bin"
     # Only install required binaries, don't install testing binaries
     for FILE in \
@@ -51,6 +57,16 @@ buildGoModule rec {
       cp "$GOPATH/bin/$FILE" "$out/bin/"
     done
 
+    # Completions
+    installShellCompletion --cmd buf \
+      --bash <($GOPATH/bin/buf completion bash) \
+      --fish <($GOPATH/bin/buf completion fish) \
+      --zsh <($GOPATH/bin/buf completion zsh)
+
+    # Man Pages
+    mkdir man && $GOPATH/bin/buf manpages man
+    installManPage man/*
+
     runHook postInstall
   '';