2024-10-04 16:56:33 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
fetchFromGitHub,
|
|
|
|
buildGoModule,
|
|
|
|
nix-update-script,
|
2022-08-12 12:06:08 +00:00
|
|
|
}:
|
2023-11-16 04:20:00 +00:00
|
|
|
buildGoModule rec {
|
2022-08-12 12:06:08 +00:00
|
|
|
pname = "hysteria";
|
2024-10-04 16:56:33 +00:00
|
|
|
version = "2.5.2";
|
2022-08-12 12:06:08 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-07-15 17:15:38 +00:00
|
|
|
owner = "apernet";
|
2022-08-21 13:32:41 +00:00
|
|
|
repo = pname;
|
2023-10-09 19:29:22 +00:00
|
|
|
rev = "app/v${version}";
|
2024-10-04 16:56:33 +00:00
|
|
|
hash = "sha256-ClWbA3cjQXK8tzXfmApBQ+TBnbRc6f36G1iIFcNQi7o=";
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
vendorHash = "sha256-I5SCr45IT8gl8eD9BburxHBodOpP+R5rk9Khczx5z8M=";
|
2022-08-12 12:06:08 +00:00
|
|
|
proxyVendor = true;
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
ldflags =
|
2024-10-04 16:56:33 +00:00
|
|
|
let
|
|
|
|
cmd = "github.com/apernet/hysteria/app/cmd";
|
|
|
|
in
|
|
|
|
[
|
2024-01-02 11:29:13 +00:00
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X ${cmd}.appVersion=${version}"
|
|
|
|
"-X ${cmd}.appType=release"
|
|
|
|
];
|
2022-10-06 18:32:54 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2023-10-09 19:29:22 +00:00
|
|
|
mv $out/bin/app $out/bin/hysteria
|
2022-10-06 18:32:54 +00:00
|
|
|
'';
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
# Network required
|
|
|
|
doCheck = false;
|
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Feature-packed proxy & relay utility optimized for lossy, unstable connections";
|
2023-07-15 17:15:38 +00:00
|
|
|
homepage = "https://github.com/apernet/hysteria";
|
2022-08-12 12:06:08 +00:00
|
|
|
license = licenses.mit;
|
2024-01-02 11:29:13 +00:00
|
|
|
platforms = platforms.unix;
|
2022-08-12 12:06:08 +00:00
|
|
|
maintainers = with maintainers; [ oluceps ];
|
2024-02-29 20:09:43 +00:00
|
|
|
mainProgram = "hysteria";
|
2022-08-12 12:06:08 +00:00
|
|
|
};
|
|
|
|
}
|