depot/third_party/nixpkgs/pkgs/by-name/hy/hysteria/package.nix

49 lines
1 KiB
Nix

{
lib,
fetchFromGitHub,
buildGoModule,
nix-update-script,
}:
buildGoModule rec {
pname = "hysteria";
version = "2.6.0";
src = fetchFromGitHub {
owner = "apernet";
repo = pname;
rev = "app/v${version}";
hash = "sha256-EdqFushE/G0kWOkks7m2nSQ9wXq1p1HjebSgb5tAzmo=";
};
vendorHash = "sha256-P4BiWeGZCI/8zehAt+5OEZhQcA9usw+OSum9gEl/gSU=";
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;
passthru.updateScript = nix-update-script { };
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";
};
}