1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 rustPlatform,
6 pkg-config,
7 openssl,
8}:
9
10rustPlatform.buildRustPackage rec {
11 pname = "shadowsocks-rust";
12 version = "1.23.5";
13
14 src = fetchFromGitHub {
15 owner = "shadowsocks";
16 repo = "shadowsocks-rust";
17 tag = "v${version}";
18 hash = "sha256-szFFnQw38d8EWDKUF3/biuniNkd4Rz4sq7TvZGM8dcc=";
19 };
20
21 cargoHash = "sha256-I+qHJ5w4aJOZCNhoMJpqOjrcmiHI+Mjfy5d8rl6L+Hw=";
22
23 nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ pkg-config ];
24
25 buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ openssl ];
26
27 buildFeatures = [
28 "trust-dns"
29 "local-tunnel"
30 "local-socks4"
31 "local-redir"
32 "local-dns"
33 "local-tun"
34 "aead-cipher-extra"
35 "aead-cipher-2022"
36 "aead-cipher-2022-extra"
37 ];
38
39 # all of these rely on connecting to www.example.com:80
40 checkFlags = [
41 "--skip=http_proxy"
42 "--skip=tcp_tunnel"
43 "--skip=tcprelay"
44 "--skip=udp_tunnel"
45 "--skip=udp_relay"
46 "--skip=socks4_relay_connect"
47 "--skip=socks5_relay_aead"
48 "--skip=socks5_relay_stream"
49 "--skip=trust_dns_resolver"
50 ];
51
52 # timeouts in sandbox
53 doCheck = false;
54
55 meta = {
56 description = "Rust port of Shadowsocks";
57 homepage = "https://github.com/shadowsocks/shadowsocks-rust";
58 changelog = "https://github.com/shadowsocks/shadowsocks-rust/raw/v${version}/debian/changelog";
59 license = lib.licenses.mit;
60 maintainers = [ ];
61 };
62}