2022-09-09 14:08:57 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, protobuf
|
|
|
|
, stdenv
|
2023-03-04 12:14:45 +00:00
|
|
|
, pkg-config
|
|
|
|
, openssl
|
2023-05-24 13:37:59 +00:00
|
|
|
, nix-update-script
|
2023-03-04 12:14:45 +00:00
|
|
|
, Security
|
2022-09-09 14:08:57 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "qdrant";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "1.3.0";
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "qdrant";
|
|
|
|
repo = "qdrant";
|
|
|
|
rev = "refs/tags/v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
sha256 = "sha256-f81CepXjU+w56yGZGJJzwp1IVOQ8vB+5WNC5icVOieA=";
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
2023-07-15 17:15:38 +00:00
|
|
|
"quantization-0.1.0" = "sha256-mhiVicQXj8639bX2mGp9XnjTNVFdd6mnk+B1B1f3ywA=";
|
|
|
|
"tonic-0.9.2" = "sha256-ZlcDUZy/FhxcgZE7DtYhAubOq8DMSO17T+TCmXar1jE=";
|
|
|
|
"wal-0.1.2" = "sha256-J+r1SaYa2ZPEfjNeVJkLYERIPLZfll02RyXeS6J/R8U=";
|
2023-03-27 19:17:25 +00:00
|
|
|
};
|
|
|
|
};
|
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
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = nix-update-script { };
|
|
|
|
};
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|