2022-09-09 14:08:57 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, protobuf
|
|
|
|
, stdenv
|
2023-03-04 12:14:45 +00:00
|
|
|
, pkg-config
|
|
|
|
, openssl
|
|
|
|
, Security
|
2022-09-09 14:08:57 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "qdrant";
|
2023-03-15 16:39:30 +00:00
|
|
|
version = "1.0.3";
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "qdrant";
|
|
|
|
repo = "qdrant";
|
|
|
|
rev = "refs/tags/v${version}";
|
2023-03-15 16:39:30 +00:00
|
|
|
sha256 = "sha256-r47mfyuM3z3SKbUi1bz8cz7BS/X8/tsIOAMKavNTgN4=";
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
cargoHash = "sha256-EwB0Vz0NyKCek2rn1QHqk5zpReMjP0o46ajete9KmWk=";
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
prePatch = lib.optionalString stdenv.isAarch64 ''
|
|
|
|
substituteInPlace .cargo/config.toml \
|
|
|
|
--replace "[target.aarch64-unknown-linux-gnu]" "" \
|
|
|
|
--replace "linker = \"aarch64-linux-gnu-gcc\"" ""
|
|
|
|
'';
|
2022-09-09 14:08:57 +00:00
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
# Needed to get openssl-sys to use pkg-config.
|
|
|
|
OPENSSL_NO_VENDOR = 1;
|
2022-09-09 14:08:57 +00:00
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ protobuf rustPlatform.bindgenHook pkg-config ];
|
|
|
|
|
|
|
|
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-faligned-allocation";
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Vector Search Engine for the next generation of AI applications";
|
|
|
|
longDescription = ''
|
|
|
|
Expects a config file at config/config.yaml with content similar to
|
|
|
|
https://github.com/qdrant/qdrant/blob/master/config/config.yaml
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/qdrant/qdrant";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ dit7ya ];
|
|
|
|
};
|
|
|
|
}
|