nixpkgs-suyu/pkgs/tools/networking/sing-box/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
1.2 KiB
Nix
Raw Normal View History

2022-12-28 08:44:35 +01:00
{ lib
2022-12-28 10:39:42 +01:00
, stdenv
2022-12-28 08:44:35 +01:00
, buildGoModule
, fetchFromGitHub
2022-12-28 10:39:42 +01:00
, installShellFiles
, buildPackages
2022-12-28 08:44:35 +01:00
}:
buildGoModule rec {
pname = "sing-box";
version = "1.1.4";
2022-12-28 08:44:35 +01:00
src = fetchFromGitHub {
owner = "SagerNet";
repo = pname;
rev = "v${version}";
hash = "sha256-OH4tuSnMdrJSkD7vxEA8dpQxWqh6bUXCOJ/y0fe2pME=";
2022-12-28 08:44:35 +01:00
};
vendorHash = "sha256-kCNtbtDnB7JZzsfUd2yMDi+pascHfxIbPVMwUVsP78g=";
2022-12-28 08:44:35 +01: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"
];
2022-12-28 10:39:42 +01:00
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 )
'';
2022-12-28 08:44:35 +01:00
meta = with lib;{
homepage = "https://sing-box.sagernet.org";
description = "The universal proxy platform";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ nickcao ];
};
}