Files
nixpkgs/pkgs/applications/editors/vim/plugins/non-generated/blink-cmp/default.nix
2025-08-09 02:17:10 +02:00

68 lines
1.5 KiB
Nix

{
lib,
rustPlatform,
fetchFromGitHub,
stdenv,
vimUtils,
nix-update-script,
gitMinimal,
}:
let
version = "1.3.0";
src = fetchFromGitHub {
owner = "Saghen";
repo = "blink.cmp";
tag = "v${version}";
hash = "sha256-8lyDDrsh3sY7l0i0TPyhL69Oq0l63+/QPnLaU/mhq5A=";
};
blink-fuzzy-lib = rustPlatform.buildRustPackage {
inherit version src;
pname = "blink-fuzzy-lib";
cargoHash = "sha256-IDoDugtNWQovfSstbVMkKHLBXKa06lxRWmywu4zyS3M=";
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
];
};
nvimSkipModules = [
# Module for reproducing issues
"repro"
];
}