depot/third_party/nixpkgs/pkgs/tools/networking/hysteria/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

43 lines
972 B
Nix

{ lib
, fetchFromGitHub
, buildGoModule
}:
buildGoModule rec {
pname = "hysteria";
version = "2.4.5";
src = fetchFromGitHub {
owner = "apernet";
repo = pname;
rev = "app/v${version}";
hash = "sha256-dRVTlH+g/pwwacrdof3n8OeLMsgZswpOwvtAx13bZGo=";
};
vendorHash = "sha256-nrcREOp92jIB8CzdOevYufpIN6l9Tcg/B4tT15d5TOE=";
proxyVendor = true;
ldflags =
let cmd = "github.com/apernet/hysteria/app/cmd";
in [
"-s"
"-w"
"-X ${cmd}.appVersion=${version}"
"-X ${cmd}.appType=release"
];
postInstall = ''
mv $out/bin/app $out/bin/hysteria
'';
# Network required
doCheck = false;
meta = with lib; {
description = "Feature-packed proxy & relay utility optimized for lossy, unstable connections";
homepage = "https://github.com/apernet/hysteria";
license = licenses.mit;
platforms = platforms.unix;
maintainers = with maintainers; [ oluceps ];
mainProgram = "hysteria";
};
}