nvf/modules/wrapper/build/packages/blink-cmp.nix

39 lines
854 B
Nix
Raw Normal View History

2025-01-01 11:31:22 +01:00
{
rustPlatform,
hostPlatform,
vimUtils,
2025-01-08 14:07:03 +01:00
git,
2025-01-01 11:31:22 +01:00
src,
version,
}: let
blink-fuzzy-lib = rustPlatform.buildRustPackage {
pname = "blink-fuzzy-lib";
inherit version src;
env = {
# TODO: remove this if plugin stops using nightly rust
RUSTC_BOOTSTRAP = true;
};
2025-01-08 14:07:03 +01:00
nativeBuildInputs = [git];
2025-01-01 11:31:22 +01:00
cargoLock = {
lockFile = "${src}/Cargo.lock";
allowBuiltinFetchGit = true;
};
};
libExt =
if hostPlatform.isDarwin
then "dylib"
else "so";
in
vimUtils.buildVimPlugin {
pname = "blink-cmp";
inherit version src;
2025-01-08 14:07:03 +01:00
# blink references a repro.lua which is placed outside the lua/ directory
doCheck = false;
2025-01-01 11:31:22 +01:00
preInstall = ''
mkdir -p target/release
ln -s ${blink-fuzzy-lib}/lib/libblink_cmp_fuzzy.${libExt} target/release/libblink_cmp_fuzzy.${libExt}
'';
}