forked from mirrors/nixpkgs
diffoci: Add shell completions
This commit is contained in:
parent
76e6b5805d
commit
198c47dd90
|
@ -1,6 +1,9 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, buildPackages
|
||||
, buildGoModule
|
||||
, fetchFromGitHub
|
||||
, installShellFiles
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
|
@ -22,6 +25,19 @@ buildGoModule rec {
|
|||
"-X=github.com/reproducible-containers/diffoci/cmd/diffoci/version.Version=v${version}"
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
postInstall =
|
||||
let
|
||||
diffoci = if stdenv.buildPlatform.canExecute stdenv.hostPlatform then placeholder "out" else buildPackages.diffoci;
|
||||
in
|
||||
''
|
||||
installShellCompletion --cmd trivy \
|
||||
--bash <(${diffoci}/bin/diffoci completion bash) \
|
||||
--fish <(${diffoci}/bin/diffoci completion fish) \
|
||||
--zsh <(${diffoci}/bin/diffoci completion zsh)
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Diff for Docker and OCI container images";
|
||||
homepage = "https://github.com/reproducible-containers/diffoci/";
|
||||
|
|
Loading…
Reference in a new issue