uplosi: add shell completion

This commit is contained in:
Paul Meyer 2024-01-15 14:52:52 +01:00
parent cf01a563f4
commit 29a3d47d2e

View file

@ -1,6 +1,7 @@
{ lib
, fetchFromGitHub
, buildGoModule
, installShellFiles
}:
buildGoModule rec {
pname = "uplosi";
@ -19,6 +20,15 @@ buildGoModule rec {
ldflags = [ "-s" "-w" "-X main.version=${version}" ];
flags = [ "-trimpath" ];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installShellCompletion --cmd uplosi \
--bash <($out/bin/uplosi completion bash) \
--fish <($out/bin/uplosi completion fish) \
--zsh <($out/bin/uplosi completion zsh)
'';
meta = with lib; {
description = "Upload OS images to cloud provider";
homepage = "https://github.com/edgelesssys/uplosi";