Enable SQLite extension loading in devshell (#48)

Override sqlite in devShell to enable extension loading for sqlite-vec
support when running tests. Only sets BREW_PREFIX if not already defined
to avoid overriding user's existing setup.

Package build remains unchanged.

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
sh54 2026-01-26 17:37:03 +01:00 committed by GitHub
parent 88f78314bb
commit 65c0f89560
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 70 additions and 1 deletions

61
flake.lock generated Normal file
View File

@ -0,0 +1,61 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1769188852,
"narHash": "sha256-aBAGyMum27K7cP5OR7BMioJOF3icquJMZDDgk6ZEg1A=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a1bab9e494f5f4939442a57a58d0449a109593fe",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View File

@ -11,6 +11,13 @@
let
pkgs = nixpkgs.legacyPackages.${system};
# SQLite with loadable extension support for sqlite-vec
sqliteWithExtensions = pkgs.sqlite.overrideAttrs (old: {
configureFlags = (old.configureFlags or []) ++ [
"--enable-load-extension"
];
});
qmd = pkgs.stdenv.mkDerivation {
pname = "qmd";
version = "1.0.0";
@ -62,10 +69,11 @@
devShells.default = pkgs.mkShell {
buildInputs = [
pkgs.bun
pkgs.sqlite
sqliteWithExtensions
];
shellHook = ''
export BREW_PREFIX="''${BREW_PREFIX:-${sqliteWithExtensions.out}}"
echo "QMD development shell"
echo "Run: bun src/qmd.ts <command>"
'';