about summary refs log tree commit diff
path: root/pkgs/tools/admin/fioctl/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/admin/fioctl/default.nix')
-rw-r--r--pkgs/tools/admin/fioctl/default.nix28
1 files changed, 22 insertions, 6 deletions
diff --git a/pkgs/tools/admin/fioctl/default.nix b/pkgs/tools/admin/fioctl/default.nix
index 8ae6c1e5a48e..d2dcc1d4953d 100644
--- a/pkgs/tools/admin/fioctl/default.nix
+++ b/pkgs/tools/admin/fioctl/default.nix
@@ -1,24 +1,40 @@
-{ lib, buildGoModule, fetchFromGitHub }:
+{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, fioctl }:
 
 buildGoModule rec {
   pname = "fioctl";
-  version = "0.25";
+  version = "0.26";
 
   src = fetchFromGitHub {
     owner = "foundriesio";
     repo = "fioctl";
     rev = "v${version}";
-    sha256 = "sha256-wRjSg0jOXDfzF4kZboFawVvujCmAeB9xDOGE0tGYl4g=";
+    sha256 = "sha256-IrbzWQEtCEG2UUkExWgs7A81RiJLXDAOrr8q4mPwcOI=";
   };
 
-  vendorSha256 = "sha256-B3VL2ZHPdx9iWK++ckzz2H8zV7ESQZCw39AEffXNu+w=";
+  vendorSha256 = "sha256-lstUcyxDVcUtgVY5y5EGgSFZgHbchQ9izf8sCq5vTVQ=";
 
   ldflags = [
-    "-s" "-w" "-X github.com/foundriesio/fioctl/subcommands/version.Commit=${src.rev}"
+    "-s" "-w"
+    "-X github.com/foundriesio/fioctl/subcommands/version.Commit=${src.rev}"
   ];
 
+  nativeBuildInputs = [ installShellFiles ];
+
+  postInstall = ''
+    installShellCompletion --cmd fioctl \
+      --bash <($out/bin/fioctl completion bash) \
+      --fish <($out/bin/fioctl completion fish) \
+      --zsh <($out/bin/fioctl completion zsh)
+  '';
+
+  passthru.tests.version = testers.testVersion {
+    package = fioctl;
+    command = "HOME=$(mktemp -d) fioctl version";
+    version = "v${version}";
+  };
+
   meta = with lib; {
-    description = "A simple CLI to manage your Foundries Factory ";
+    description = "A simple CLI to manage your Foundries Factory";
     homepage = "https://github.com/foundriesio/fioctl";
     license = licenses.asl20;
     maintainers = with maintainers; [ nixinator matthewcroughan ];