{ lib, rustPlatform, fetchFromGitHub, stdenv, vimUtils, nix-update-script, gitMinimal, }: let version = "1.10.2"; src = fetchFromGitHub { owner = "Saghen"; repo = "blink.cmp"; tag = "v${version}"; hash = "sha256-C1FpyGw0f35NdHvDUGPXxmKdOgw3SpIteK1gAjVy6Ns="; }; blink-fuzzy-lib = rustPlatform.buildRustPackage { inherit version src; pname = "blink-fuzzy-lib"; cargoHash = "sha256-z8koRYVM9mkgKB6rdZAKIfjZfinVUUpYAW0IvPgmjZ4="; nativeBuildInputs = [ gitMinimal ]; env = { # TODO: remove this if plugin stops using nightly rust RUSTC_BOOTSTRAP = true; # Allow undefined symbols on Darwin - they will be provided by Neovim's LuaJIT runtime RUSTFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-C link-arg=-undefined -C link-arg=dynamic_lookup"; }; }; 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"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ balssh redxtech llakala ]; }; nvimSkipModules = [ # Module for reproducing issues "repro" ]; }