@@ -0,0 +1,40 @@
1+{ lib
2+, stdenv
3+, rustPlatform
4+, fetchFromGitHub
5+, openssl
6+, postgresql
7+, libiconv
8+, Security
9+}:
10+
11+rustPlatform.buildRustPackage rec {
12+ pname = "lemmy-server";
13+ version = "0.11.2";
14+
15+ src = fetchFromGitHub {
16+ owner = "LemmyNet";
17+ repo = "lemmy";
18+ rev = version;
19+ sha256 = "sha256-wDRBeAYjPpAd3DL99fH4Yng994hGmAmxlBqzOeXTP88=";
20+ };
21+
22+ cargoSha256 = "sha256-7wF5mUjSeJvCNLZcR6XB31RX2RLOOEyTGpOQxg+NcWk=";
23+
24+ buildInputs = [ postgresql ]
25+ ++ lib.optionals stdenv.isDarwin [ libiconv Security ];
26+
27+ # Using OPENSSL_NO_VENDOR is not an option on darwin
28+ # As of version 0.10.35 rust-openssl looks for openssl on darwin
29+ # with a hardcoded path to /usr/lib/libssl.x.x.x.dylib
30+ # https://github.com/sfackler/rust-openssl/blob/master/openssl-sys/build/find_normal.rs#L115
31+ OPENSSL_LIB_DIR = "${openssl.out}/lib";
32+ OPENSSL_INCLUDE_DIR = "${openssl.dev}/include";
33+
34+ meta = with lib; {
35+ description = "Ultra relevant and instant full-text search API";
36+ homepage = "https://join-lemmy.org/";
37+ license = licenses.agpl3Only;
38+ maintainers = with maintainers; [ happysalada ];
39+ };
40+}