Files

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

69 lines
1.5 KiB
Nix
Raw Permalink Normal View History

2025-10-09 14:15:47 +02:00
{
lib,
rustPlatform,
fetchFromGitHub,
stdenv,
vimUtils,
nix-update-script,
gitMinimal,
}:
let
version = "1.7.0";
src = fetchFromGitHub {
owner = "Saghen";
repo = "blink.cmp";
tag = "v${version}";
hash = "sha256-eMUOjG2CtedCGVU1Pdp8PCCgGoFbjeVvK7lMS8E+ogg=";
};
blink-fuzzy-lib = rustPlatform.buildRustPackage {
inherit version src;
pname = "blink-fuzzy-lib";
cargoHash = "sha256-zWZHT+Y8ENN/nFEtJnkEUHXRuU6FUQ/ITHo+V4zJ6f8=";
nativeBuildInputs = [ gitMinimal ];
env = {
# TODO: remove this if plugin stops using nightly rust
RUSTC_BOOTSTRAP = true;
};
};
in
vimUtils.buildVimPlugin {
pname = "blink.cmp";
inherit version src;
preInstall =
let
ext = stdenv.hostPlatform.extensions.sharedLibrary;
in
''
mkdir -p target/release
ln -s ${blink-fuzzy-lib}/lib/libblink_cmp_fuzzy${ext} target/release/libblink_cmp_fuzzy${ext}
'';
passthru = {
updateScript = nix-update-script {
attrPath = "vimPlugins.blink-cmp.blink-fuzzy-lib";
};
# needed for the update script
inherit blink-fuzzy-lib;
};
meta = {
description = "Performant, batteries-included completion plugin for Neovim";
homepage = "https://github.com/saghen/blink.cmp";
changelog = "https://github.com/Saghen/blink.cmp/blob/v${version}/CHANGELOG.md";
maintainers = with lib.maintainers; [
balssh
redxtech
llakala
];
};
nvimSkipModules = [
# Module for reproducing issues
"repro"
];
}