nixpkgs/pkgs/servers/mail/stalwart/default.nix
2024-01-13 20:57:59 +01:00

72 lines
1.4 KiB
Nix

{ lib
, rustPlatform
, fetchFromGitHub
, pkg-config
, protobuf
, bzip2
, openssl
, sqlite
, zstd
, stdenv
, darwin
, nix-update-script
, rocksdb
}:
let
version = "0.5.2";
in
rustPlatform.buildRustPackage {
pname = "stalwart-mail";
inherit version;
src = fetchFromGitHub {
owner = "stalwartlabs";
repo = "mail-server";
rev = "v${version}";
hash = "sha256-U53v123mLD9mGmsNKgHlad8+2vr9lzMXizT4KeOChJY=";
fetchSubmodules = true;
};
cargoLock = {
lockFile = ./Cargo.lock;
};
nativeBuildInputs = [
pkg-config
protobuf
rustPlatform.bindgenHook
];
buildInputs = [
bzip2
openssl
sqlite
zstd
] ++ lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.CoreFoundation
darwin.apple_sdk.frameworks.Security
darwin.apple_sdk.frameworks.SystemConfiguration
];
env = {
OPENSSL_NO_VENDOR = true;
ZSTD_SYS_USE_PKG_CONFIG = true;
ROCKSDB_INCLUDE_DIR = "${rocksdb}/include";
ROCKSDB_LIB_DIR = "${rocksdb}/lib";
};
# Tests require reading to /etc/resolv.conf
doCheck = false;
passthru.update-script = nix-update-script { };
meta = with lib; {
description = "Secure & Modern All-in-One Mail Server (IMAP, JMAP, SMTP)";
homepage = "https://github.com/stalwartlabs/mail-server";
changelog = "https://github.com/stalwartlabs/mail-server/blob/${version}/CHANGELOG";
license = licenses.agpl3Only;
maintainers = with maintainers; [ happysalada ];
};
}