wormhole-william: install shell completions (#362652)

This commit is contained in:
Aleksana 2024-12-08 17:13:06 +08:00 committed by GitHub
commit 4eca165339
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,4 @@
{ lib, buildGoModule, fetchFromGitHub }:
{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "wormhole-william";
@ -22,6 +22,15 @@ buildGoModule rec {
"SkipWormholeDirectoryTransportSendRecvDirect"
'';
nativeBuildInputs = [ installShellFiles ];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd wormhole-william \
--bash <($out/bin/wormhole-william shell-completion bash) \
--fish <($out/bin/wormhole-william shell-completion fish) \
--zsh <($out/bin/wormhole-william shell-completion zsh)
'';
meta = with lib; {
homepage = "https://github.com/psanford/wormhole-william";
description = "End-to-end encrypted file transfers";