mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 09:23:01 +00:00
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 New Issue
Block a user