diff options
author | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2024-05-11 18:06:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-11 18:06:49 +0200 |
commit | c3f3a1027b2b5090ceb40fd27456a3d2e0c6ba56 (patch) | |
tree | da21a90c42b235d4a3f41d768eb2ed154ec5c8c4 /pkgs/tools/security | |
parent | b4e657ab638e5ad2ea60943e526f91af38203a2b (diff) | |
parent | dbea610adb066461707730968fcd629542357c61 (diff) |
Merge pull request #310737 from aaronjheng/notation
notation: add shell completions
Diffstat (limited to 'pkgs/tools/security')
-rw-r--r-- | pkgs/tools/security/notation/default.nix | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/pkgs/tools/security/notation/default.nix b/pkgs/tools/security/notation/default.nix index 07c9ef4997172..f9318296060f5 100644 --- a/pkgs/tools/security/notation/default.nix +++ b/pkgs/tools/security/notation/default.nix @@ -1,4 +1,4 @@ -{ lib, buildGoModule, fetchFromGitHub, testers, notation }: +{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, notation }: buildGoModule rec { pname = "notation"; @@ -13,6 +13,10 @@ buildGoModule rec { vendorHash = "sha256-USkufc1dG4eyRfRJHSX4mVZHnvOc5onHenF98Aedac4="; + nativeBuildInputs = [ + installShellFiles + ]; + # This is a Go sub-module and cannot be built directly (e2e tests). excludedPackages = [ "./test" ]; @@ -23,6 +27,13 @@ buildGoModule rec { "-X github.com/notaryproject/notation/internal/version.BuildMetadata=" ]; + postInstall = '' + installShellCompletion --cmd notation \ + --bash <($out/bin/notation completion bash) \ + --fish <($out/bin/notation completion fish) \ + --zsh <($out/bin/notation completion zsh) + ''; + passthru.tests.version = testers.testVersion { package = notation; command = "notation version"; |