nixpkgs/pkgs/tools/networking/hysteria/default.nix
2023-11-19 17:15:29 +08:00

40 lines
841 B
Nix

{ lib
, fetchFromGitHub
, buildGoModule
}:
buildGoModule rec {
pname = "hysteria";
version = "2.2.1";
src = fetchFromGitHub {
owner = "apernet";
repo = pname;
rev = "app/v${version}";
hash = "sha256-3ovJVo3Jqkq067XgDMxW5efCp6Ivfex4LbuUyR0cB8s=";
};
vendorHash = "sha256-ErU1yEtSuMVkoJv9hyaE4OZS5o7GxuleoK0Q9BI2skw=";
proxyVendor = true;
ldflags = [
"-s"
"-w"
"-X main.appVersion=${version}"
];
postInstall = ''
mv $out/bin/app $out/bin/hysteria
'';
# Network required
doCheck = false;
meta = with lib; {
description = "A feature-packed proxy & relay utility optimized for lossy, unstable connections";
homepage = "https://github.com/apernet/hysteria";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ oluceps ];
};
}