From ff9420be0064957d49e136720430fbd74f88b1f4 Mon Sep 17 00:00:00 2001 From: oluceps Date: Tue, 12 Mar 2024 14:52:26 +0800 Subject: [PATCH] trojan-rs: init at 0.16.0-unstable-2024-11-21 Co-authored-by: linsui Co-authored-by: Arne Keller <2012gdwu+github@posteo.de> --- pkgs/by-name/tr/trojan-rs/package.nix | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 pkgs/by-name/tr/trojan-rs/package.nix diff --git a/pkgs/by-name/tr/trojan-rs/package.nix b/pkgs/by-name/tr/trojan-rs/package.nix new file mode 100644 index 0000000000000..a748e7687aaa0 --- /dev/null +++ b/pkgs/by-name/tr/trojan-rs/package.nix @@ -0,0 +1,34 @@ +{ + fetchFromGitHub, + rustPlatform, + lib, + ipset, +}: + +rustPlatform.buildRustPackage { + pname = "trojan-rs"; + version = "0.16.0-unstable-2024-11-21"; + + src = fetchFromGitHub { + owner = "lazytiger"; + repo = "trojan-rs"; + rev = "a996b83e3d57b571fa59f01034fcdd32a09ee8bc"; + hash = "sha256-rtYvsFxxhkUuR/tLrRFvRBLG8C84Qs0kYmXkNP/Ai3c="; + }; + + cargoHash = "sha256-FJV4pMfaw4rHTYZekot5ZTBDChfS1gCPc5NqoLeGjws="; + + nativeBuildInputs = [ rustPlatform.bindgenHook ]; + buildInputs = [ ipset ]; + + env.RUSTC_BOOTSTRAP = true; + env.RUSTFLAGS = "--cfg tokio_unstable"; + + meta = { + homepage = "https://github.com/lazytiger/trojan-rs"; + description = "Trojan server and proxy programs written in Rust"; + license = lib.licenses.mit; + mainProgram = "trojan"; + maintainers = with lib.maintainers; [ oluceps ]; + }; +}