-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathflake.nix
More file actions
57 lines (49 loc) · 1.54 KB
/
flake.nix
File metadata and controls
57 lines (49 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{
description = "SQLite Vector Extension";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
stdenv = pkgs.stdenv;
version = "0.9.53";
in
{
packages.default = stdenv.mkDerivation {
pname = "sqlite-vector";
inherit version;
src = pkgs.lib.cleanSource ./.;
makeFlags = [
"CC=${stdenv.cc.targetPrefix}cc"
] ++ pkgs.lib.optionals stdenv.isDarwin [
"ARCH=${if stdenv.hostPlatform.isAarch64 then "arm64" else "x86_64"}"
];
installPhase = "install -D dist/vector* -t $out/lib";
checkInputs = [ pkgs.sqlite ];
doCheck = true;
checkPhase = ''
make test
'';
};
devShells.default =
let
sqlite-vector = self.packages.${system}.default;
in
pkgs.mkShell {
packages = [
pkgs.sqlite
pkgs.gnumake
sqlite-vector
];
shellHook = ''
export SQLITE_VECTOR_LIB="${sqlite-vector}/lib/vector${stdenv.hostPlatform.extensions.sharedLibrary}"
echo "SQLite Vector extension available at: $SQLITE_VECTOR_LIB"
echo "Load it in sqlite3 with: .load $SQLITE_VECTOR_LIB"
'';
};
}
);
}