14 pinData = lib.importJSON ./pin.json;
15 version = pinData.version;
17 rustPlatform.buildRustPackage rec {
19 pname = "lemmy-server";
21 src = fetchFromGitHub {
25 sha256 = pinData.serverSha256;
26 fetchSubmodules = true;
29 cargoSha256 = pinData.serverCargoSha256;
31 buildInputs = [ postgresql ]
32 ++ lib.optionals stdenv.isDarwin [ libiconv Security ];
34 # Using OPENSSL_NO_VENDOR is not an option on darwin
35 # As of version 0.10.35 rust-openssl looks for openssl on darwin
36 # with a hardcoded path to /usr/lib/libssl.x.x.x.dylib
37 # https://github.com/sfackler/rust-openssl/blob/master/openssl-sys/build/find_normal.rs#L115
38 OPENSSL_LIB_DIR = "${lib.getLib openssl}/lib";
39 OPENSSL_INCLUDE_DIR = "${openssl.dev}/include";
41 PROTOC = "${protobuf}/bin/protoc";
42 PROTOC_INCLUDE = "${protobuf}/include";
43 nativeBuildInputs = [ protobuf rustfmt ];
45 passthru.updateScript = ./update.sh;
46 passthru.tests.lemmy-server = nixosTests.lemmy;
49 doInstallCheck = false;
52 description = "🐀 Building a federated alternative to reddit in rust";
53 homepage = "https://join-lemmy.org/";
54 license = licenses.agpl3Only;
55 maintainers = with maintainers; [ happysalada billewanick ];
56 mainProgram = "lemmy_server";