Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

56 lines
1.3 KiB
Nix
Raw Permalink Normal View History

2025-10-09 14:15:47 +02:00
{
lib,
rustPlatform,
fetchgit,
rust-jemalloc-sys,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "postgres-lsp";
version = "0.15.0";
src = fetchgit {
url = "https://github.com/supabase-community/postgres-language-server";
tag = finalAttrs.version;
hash = "sha256-ZintjrSeNsYR6A8tlEfSetse7d79jgLdCpdu+sMe3Zk=";
fetchSubmodules = true;
};
cargoHash = "sha256-x/Wbx3noH6YOQIis1sN8ylQApjhSy4/mrxX6jvZFs6A=";
nativeBuildInputs = [
rustPlatform.bindgenHook
];
buildInputs = [
rust-jemalloc-sys
];
env = {
SQLX_OFFLINE = 1;
# As specified in the upstream: https://github.com/supabase-community/postgres-language-server/blob/main/.github/workflows/release.yml
RUSTFLAGS = "-C strip=symbols -C codegen-units=1";
PGT_VERSION = finalAttrs.version;
};
cargoBuildFlags = [ "-p=pgt_cli" ];
cargoTestFlags = finalAttrs.cargoBuildFlags;
checkFlags = [
# Tries to write to the file system relatively to the current path
"--skip=syntax_error"
# Requires a database connection
"--skip=test_cli_check_command"
];
meta = {
description = "Tools and language server for Postgres";
homepage = "https://pgtools.dev";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
figsoda
myypo
];
mainProgram = "postgrestools";
};
})