15 pinData = lib.importJSON ./pin.json;
16 version = pinData.serverVersion;
18 rustPlatform.buildRustPackage rec {
20 pname = "lemmy-server";
22 src = fetchFromGitHub {
26 hash = pinData.serverHash;
27 fetchSubmodules = true;
31 echo 'pub const VERSION: &str = "${version}";' > crates/utils/src/version.rs
34 cargoHash = pinData.serverCargoHash;
36 buildInputs = [ postgresql ]
37 ++ lib.optionals stdenv.hostPlatform.isDarwin [ libiconv Security SystemConfiguration ];
39 # Using OPENSSL_NO_VENDOR is not an option on darwin
40 # As of version 0.10.35 rust-openssl looks for openssl on darwin
41 # with a hardcoded path to /usr/lib/libssl.x.x.x.dylib
42 # https://github.com/sfackler/rust-openssl/blob/master/openssl-sys/build/find_normal.rs#L115
43 OPENSSL_LIB_DIR = "${lib.getLib openssl}/lib";
44 OPENSSL_INCLUDE_DIR = "${openssl.dev}/include";
46 PROTOC = "${protobuf}/bin/protoc";
47 PROTOC_INCLUDE = "${protobuf}/include";
48 nativeBuildInputs = [ protobuf rustfmt ];
51 # test requires database access
52 "--skip=session_middleware::tests::test_session_auth"
54 # tests require network access
55 "--skip=scheduled_tasks::tests::test_nodeinfo_mastodon_social"
56 "--skip=scheduled_tasks::tests::test_nodeinfo_voyager_lemmy_ml"
59 passthru.updateScript = ./update.py;
60 passthru.tests.lemmy-server = nixosTests.lemmy;
63 description = "🐀 Building a federated alternative to reddit in rust";
64 homepage = "https://join-lemmy.org/";
65 license = licenses.agpl3Only;
66 maintainers = with maintainers; [ happysalada billewanick georgyo ];
67 mainProgram = "lemmy_server";