3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/servers/web-apps/lemmy/server.nix

51 lines
1.3 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, rustPlatform
, fetchFromGitHub
, openssl
, postgresql
, libiconv
, Security
2022-01-16 20:06:27 +00:00
, protobuf
}:
let
pinData = lib.importJSON ./pin.json;
version = pinData.version;
in
rustPlatform.buildRustPackage rec {
inherit version;
pname = "lemmy-server";
src = fetchFromGitHub {
owner = "LemmyNet";
repo = "lemmy";
rev = version;
sha256 = pinData.serverSha256;
};
cargoSha256 = pinData.serverCargoSha256;
buildInputs = [ postgresql ]
++ lib.optionals stdenv.isDarwin [ libiconv Security ];
# Using OPENSSL_NO_VENDOR is not an option on darwin
# As of version 0.10.35 rust-openssl looks for openssl on darwin
# with a hardcoded path to /usr/lib/libssl.x.x.x.dylib
# https://github.com/sfackler/rust-openssl/blob/master/openssl-sys/build/find_normal.rs#L115
OPENSSL_LIB_DIR = "${openssl.out}/lib";
OPENSSL_INCLUDE_DIR = "${openssl.dev}/include";
2022-01-16 20:06:27 +00:00
PROTOC = "${protobuf}/bin/protoc";
PROTOC_INCLUDE = "${protobuf}/include";
nativeBuildInputs = [ protobuf ];
passthru.updateScript = ./update.sh;
meta = with lib; {
2021-09-03 04:01:06 +01:00
description = "🐀 Building a federated alternative to reddit in rust";
homepage = "https://join-lemmy.org/";
license = licenses.agpl3Only;
maintainers = with maintainers; [ happysalada ];
};
}