@@ -0,0 +1,29 @@
1+{ stdenv, fetchFromGitHub, rustPlatform, pkgconfig, openssl, libsodium, Security }:
2+
3+rustPlatform.buildRustPackage rec {
4+ pname = "shadowsocks-rust";
5+ version = "1.7.0";
6+
7+ src = fetchFromGitHub {
8+ rev = "v${version}";
9+ owner = "shadowsocks";
10+ repo = pname;
11+ sha256 = "0mqjm54mp6c9mfdl3gf01v9vm2rjll8fw63n6j4qgv01y4hrsm4f";
12+ };
13+
14+ cargoSha256 = "1m0p40z6qx6s0r1x6apz56n2s4ppn8b2cff476xrfhp6s1j046q7";
15+
16+ buildInputs = [ openssl libsodium ]
17+ ++ stdenv.lib.optionals stdenv.isDarwin [ Security ];
18+ nativeBuildInputs = [ pkgconfig ];
19+
20+ # tries to read /etc/resolv.conf, hence fails in sandbox
21+ doCheck = false;
22+
23+ meta = with stdenv.lib; {
24+ homepage = https://github.com/shadowsocks/shadowsocks-rust;
25+ description = "A Rust port of shadowsocks";
26+ license = licenses.mit;
27+ maintainers = [ maintainers.marsam ];
28+ };
29+}