dive: add shell completion (#414102)

This commit is contained in:
Aleksana
2025-06-05 10:55:30 +08:00
committed by GitHub
+12 -1
View File
@@ -4,6 +4,7 @@
buildGoModule,
fetchFromGitHub,
pkg-config,
installShellFiles,
btrfs-progs,
gpgme,
lvm2,
@@ -21,7 +22,10 @@ buildGoModule rec {
vendorHash = "sha256-egsFnnHZMPRTJeFw6uByE9OJH06zqKRTvQi9XhegbDI=";
nativeBuildInputs = [ pkg-config ];
nativeBuildInputs = [
pkg-config
installShellFiles
];
buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
btrfs-progs
@@ -35,6 +39,13 @@ buildGoModule rec {
"-X main.version=${version}"
];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd dive \
--bash <($out/bin/dive completion bash) \
--fish <($out/bin/dive completion fish) \
--zsh <($out/bin/dive completion zsh)
'';
meta = {
description = "Tool for exploring each layer in a docker image";
mainProgram = "dive";