12 stdenv.mkDerivation (finalAttrs: {
16 src = fetchFromGitHub {
19 rev = "v${finalAttrs.version}";
20 hash = "sha256-cb9UlSUAZp8B5NpNDBvJ2+ung98gjVKLxrM2Ek9fOcs=";
23 patches = [ ./use-nixpkgs-libs.patch ];
25 nativeBuildInputs = [ cmake ];
27 buildInputs = [ nlohmann_json faiss sqlite ]
28 ++ lib.optional stdenv.hostPlatform.isLinux gomp
29 ++ lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp;
31 SQLITE_VSS_CMAKE_VERSION = finalAttrs.version;
36 install -Dm444 -t "$out/lib" \
37 "libsqlite_vector0${stdenv.hostPlatform.extensions.staticLibrary}" \
38 "libsqlite_vss0${stdenv.hostPlatform.extensions.staticLibrary}" \
39 "vector0${stdenv.hostPlatform.extensions.sharedLibrary}" \
40 "vss0${stdenv.hostPlatform.extensions.sharedLibrary}"
46 # Low maintenance mode, doesn't support up-to-date faiss
47 # https://github.com/NixOS/nixpkgs/pull/330191#issuecomment-2252965866
48 broken = lib.versionAtLeast faiss.version "1.8.0";
49 description = "SQLite extension for efficient vector search based on Faiss";
50 homepage = "https://github.com/asg017/sqlite-vss";
51 changelog = "https://github.com/asg017/sqlite-vss/releases/tag/v${finalAttrs.version}";
52 license = licenses.mit;
53 platforms = platforms.unix;