diff --git a/ext/pgvector.nix b/ext/pgvector.nix new file mode 100644 index 0000000..fa2f55d --- /dev/null +++ b/ext/pgvector.nix @@ -0,0 +1,31 @@ +{ lib, stdenv, fetchFromGitHub, postgresql }: + +stdenv.mkDerivation rec { + pname = "pgvector"; + version = "0.5.1"; + + buildInputs = [ postgresql ]; + + src = fetchFromGitHub { + owner = "pgvector"; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-ZNzq+dATZn9LUgeOczsaadr5hwdbt9y/+sAOPIdr77U="; + }; + + installPhase = '' + mkdir -p $out/{lib,share/postgresql/extension} + + cp *.so $out/lib + cp sql/*.sql $out/share/postgresql/extension + cp *.control $out/share/postgresql/extension + ''; + + meta = with lib; { + description = "Open-source vector similarity search for Postgres"; + homepage = "https://github.com/${src.owner}/${src.repo}"; + maintainers = with maintainers; [ olirice ]; + platforms = postgresql.meta.platforms; + license = licenses.postgresql; + }; +} diff --git a/flake.nix b/flake.nix index 21ff904..1c49b1c 100644 --- a/flake.nix +++ b/flake.nix @@ -73,7 +73,6 @@ /* pljava */ "plv8" "rum" - "pgvector" "pg_repack" "pgroonga" ]; @@ -97,6 +96,7 @@ ./ext/pg_graphql.nix ./ext/pg_stat_monitor.nix ./ext/pg_jsonschema.nix + ./ext/pgvector.nix ./ext/vault.nix ./ext/hypopg.nix ./ext/pg_tle.nix