1{ lib, stdenv, fetchFromGitHub, postgresql }:
2
3stdenv.mkDerivation rec {
4 pname = "pg_embedding";
5 version = "0.3.6";
6
7 src = fetchFromGitHub {
8 owner = "neondatabase";
9 repo = pname;
10 rev = version;
11 hash = "sha256-NTBxsQB8mR7e/CWwkCEyDiYhi3Nxl/aKgRBwqc0THcI=";
12 };
13
14 buildInputs = [ postgresql ];
15
16 installPhase = ''
17 install -D -t $out/lib *.so
18 install -D -t $out/share/postgresql/extension *.sql
19 install -D -t $out/share/postgresql/extension *.control
20 '';
21
22 meta = with lib; {
23 description = "PostgreSQL extension implementing the HNSW algorithm for vector similarity search";
24 homepage = "https://github.com/neondatabase/pg_embedding";
25 maintainers = with maintainers; [ ];
26 platforms = postgresql.meta.platforms;
27 license = licenses.asl20;
28 };
29}