2023-01-11 07:51:40 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, buildPackages
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "sing-box";
|
2023-02-02 18:25:31 +00:00
|
|
|
version = "1.1.5";
|
2023-01-11 07:51:40 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "SagerNet";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-02-02 18:25:31 +00:00
|
|
|
hash = "sha256-FEwyJL6pFdp9vXIq1TUFGGDfKefFsVaajjX2U0R5Vog=";
|
2023-01-11 07:51:40 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
vendorHash = "sha256-QTk4kKPPOhnCf/1NhWObwf8EsZC+k0EtdSBecD6jq04=";
|
2023-01-11 07:51:40 +00:00
|
|
|
|
|
|
|
tags = [
|
|
|
|
"with_quic"
|
|
|
|
"with_grpc"
|
|
|
|
"with_wireguard"
|
|
|
|
"with_shadowsocksr"
|
|
|
|
"with_ech"
|
|
|
|
"with_utls"
|
|
|
|
"with_acme"
|
|
|
|
"with_clash_api"
|
|
|
|
"with_v2ray_api"
|
|
|
|
"with_gvisor"
|
|
|
|
];
|
|
|
|
|
|
|
|
subPackages = [
|
|
|
|
"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";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ nickcao ];
|
|
|
|
};
|
|
|
|
}
|