sing-box: install shell completions
This commit is contained in:
parent
b851cbd5b2
commit
433a78bcdb
|
@ -1,6 +1,9 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, buildGoModule
|
||||
, fetchFromGitHub
|
||||
, installShellFiles
|
||||
, buildPackages
|
||||
}:
|
||||
|
||||
buildGoModule rec {
|
||||
|
@ -33,6 +36,15 @@ buildGoModule rec {
|
|||
"cmd/sing-box"
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
postInstall = let emulator = stdenv.hostPlatform.emulator buildPackages; in ''
|
||||
installShellCompletion --cmd sing-box \
|
||||
--bash <(${emulator} $out/bin/sing-box completion bash) \
|
||||
--fish <(${emulator} $out/bin/sing-box completion fish) \
|
||||
--zsh <(${emulator} $out/bin/sing-box completion zsh )
|
||||
'';
|
||||
|
||||
meta = with lib;{
|
||||
homepage = "https://sing-box.sagernet.org";
|
||||
description = "The universal proxy platform";
|
||||
|
|
Loading…
Reference in a new issue