16 pinData = lib.importJSON ./pin.json;
17 version = pinData.serverVersion;
19 rustPlatform.buildRustPackage rec {
21 pname = "lemmy-server";
23 src = fetchFromGitHub {
27 hash = pinData.serverHash;
28 fetchSubmodules = true;
32 echo 'pub const VERSION: &str = "${version}";' > crates/utils/src/version.rs
35 cargoHash = pinData.serverCargoHash;
39 ++ lib.optionals stdenv.hostPlatform.isDarwin [
45 # Using OPENSSL_NO_VENDOR is not an option on darwin
46 # As of version 0.10.35 rust-openssl looks for openssl on darwin
47 # with a hardcoded path to /usr/lib/libssl.x.x.x.dylib
48 # https://github.com/sfackler/rust-openssl/blob/master/openssl-sys/build/find_normal.rs#L115
49 OPENSSL_LIB_DIR = "${lib.getLib openssl}/lib";
50 OPENSSL_INCLUDE_DIR = "${openssl.dev}/include";
52 PROTOC = "${protobuf}/bin/protoc";
53 PROTOC_INCLUDE = "${protobuf}/include";
60 # test requires database access
61 "--skip=session_middleware::tests::test_session_auth"
63 # tests require network access
64 "--skip=scheduled_tasks::tests::test_nodeinfo_mastodon_social"
65 "--skip=scheduled_tasks::tests::test_nodeinfo_lemmy_ml"
68 passthru.updateScript = ./update.py;
69 passthru.tests.lemmy-server = nixosTests.lemmy;
72 description = "🐀 Building a federated alternative to reddit in rust";
73 homepage = "https://join-lemmy.org/";
74 license = licenses.agpl3Only;
75 maintainers = with maintainers; [
80 mainProgram = "lemmy_server";