From 7ee41e85e80f0f9ec9853ba841efb251d15328ad Mon Sep 17 00:00:00 2001 From: Martin Hardselius Date: Wed, 13 Oct 2021 22:20:33 +0200 Subject: [PATCH] steampipe: install shell completion --- pkgs/tools/misc/steampipe/default.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/misc/steampipe/default.nix b/pkgs/tools/misc/steampipe/default.nix index 0df0b3c4e31c..691351c89b08 100644 --- a/pkgs/tools/misc/steampipe/default.nix +++ b/pkgs/tools/misc/steampipe/default.nix @@ -1,4 +1,4 @@ -{ lib, buildGoModule, fetchFromGitHub }: +{ lib, buildGoModule, fetchFromGitHub, installShellFiles }: buildGoModule rec { pname = "steampipe"; @@ -16,11 +16,21 @@ buildGoModule rec { # tests are failing for no obvious reasons doCheck = false; + nativeBuildInputs = [ installShellFiles ]; + ldflags = [ "-s" "-w" ]; + postInstall = '' + INSTALL_DIR=$(mktemp -d) + installShellCompletion --cmd steampipe \ + --bash <($out/bin/steampipe --install-dir $INSTALL_DIR completion bash) \ + --fish <($out/bin/steampipe --install-dir $INSTALL_DIR completion fish) \ + --zsh <($out/bin/steampipe --install-dir $INSTALL_DIR completion zsh) + ''; + meta = with lib; { homepage = "https://steampipe.io/"; description = "select * from cloud;";