From c94a2de710315167dcbbf28b613a5c11c4ca7cd8 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Wed, 8 Jul 2020 04:20:00 -0500 Subject: [PATCH] golangci-lint: install completions --- pkgs/development/tools/golangci-lint/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/development/tools/golangci-lint/default.nix b/pkgs/development/tools/golangci-lint/default.nix index e98a6172de64..3b3863a62e73 100644 --- a/pkgs/development/tools/golangci-lint/default.nix +++ b/pkgs/development/tools/golangci-lint/default.nix @@ -1,4 +1,4 @@ -{ buildGoModule, fetchFromGitHub, lib }: +{ buildGoModule, fetchFromGitHub, lib, installShellFiles }: buildGoModule rec { pname = "golangci-lint"; @@ -14,6 +14,15 @@ buildGoModule rec { vendorSha256 = "0dg3rjzkvzh4n7r4kp68qhg96ijqks9hkz1cjcc02xa38ygma7gz"; subPackages = [ "cmd/golangci-lint" ]; + nativeBuildInputs = [ installShellFiles ]; + + postInstall = '' + for shell in bash zsh; do + HOME=$TMPDIR $out/bin/golangci-lint completion $shell > golangci-lint.$shell + installShellCompletion golangci-lint.$shell + done + ''; + meta = with lib; { description = "Linters Runner for Go. 5x faster than gometalinter. Nice colored output."; homepage = "https://golangci.com/";