desync: add shell completion

This commit is contained in:
Artem Leshchev
2025-12-08 15:08:34 -06:00
parent a0ea537a4f
commit ac8c98ae28
+11
View File
@@ -1,7 +1,9 @@
{
stdenv,
lib,
buildGoModule,
fetchFromGitHub,
installShellFiles,
}:
buildGoModule rec {
@@ -17,9 +19,18 @@ buildGoModule rec {
vendorHash = "sha256-CBw5FFGQgvdYoOUZ6E1F/mxqzNKOwh2IZbsh0dAsLEE=";
nativeBuildInputs = [ installShellFiles ];
# nix builder doesn't have access to test data; tests fail for reasons unrelated to binary being bad.
doCheck = false;
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd desync \
--bash <($out/bin/desync completion bash) \
--fish <($out/bin/desync completion fish) \
--zsh <($out/bin/desync completion zsh)
'';
meta = {
description = "Content-addressed binary distribution system";
mainProgram = "desync";