flake: add plugin blink.cmp

This commit is contained in:
Ching Pei Yang 2024-12-23 02:48:28 +01:00
parent 6e3c9cbc1e
commit 8897e164ba
No known key found for this signature in database
GPG key ID: B3841364253DC4C8
3 changed files with 53 additions and 0 deletions

View file

@ -188,6 +188,22 @@
"type": "github"
}
},
"plugin-blink-cmp": {
"flake": false,
"locked": {
"lastModified": 1734880418,
"narHash": "sha256-jR9fvo+I51DKYQb+N3nFvQ50N+lvYzfFaQtrn7cxDu4=",
"owner": "saghen",
"repo": "blink.cmp",
"rev": "f93af0f486ada13e8c34f42c911788b9232b811f",
"type": "github"
},
"original": {
"owner": "saghen",
"repo": "blink.cmp",
"type": "github"
}
},
"plugin-bufdelete-nvim": {
"flake": false,
"locked": {
@ -2076,6 +2092,7 @@
"nmd": "nmd",
"plugin-alpha-nvim": "plugin-alpha-nvim",
"plugin-base16": "plugin-base16",
"plugin-blink-cmp": "plugin-blink-cmp",
"plugin-bufdelete-nvim": "plugin-bufdelete-nvim",
"plugin-catppuccin": "plugin-catppuccin",
"plugin-ccc": "plugin-ccc",

View file

@ -288,6 +288,11 @@
flake = false;
};
plugin-blink-cmp = {
url = "github:saghen/blink.cmp";
flake = false;
};
plugin-nvim-cmp = {
url = "github:hrsh7th/nvim-cmp";
flake = false;

View file

@ -72,6 +72,37 @@
pname = "flutter-tools";
patches = [../patches/flutter-tools.patch];
};
blink-cmp = let
version = inputs.plugin-blink-cmp.shortRev or inputs.plugin-blink-cmp.shortDirtyRev or "dirty";
src = inputs.plugin-blink-cmp;
blink-fuzzy-lib = pkgs.rustPlatform.buildRustPackage {
pname = "blink-fuzzy-lib";
inherit version src;
env = {
# TODO: remove this if plugin stops using nightly rust
RUSTC_BOOTSTRAP = true;
};
cargoLock = {
lockFile = "${src}/Cargo.lock";
outputHashes = {
"frizbee-0.1.0" = "sha256-pt6sMsRyjXrbrTK7t/YvWeen/n3nU8UUaiNYTY1LczE=";
};
};
};
libExt =
if pkgs.hostPlatform.isDarwin
then "dylib"
else "so";
in
buildPlug {
pname = "blink-cmp";
inherit version src;
preInstall = ''
mkdir -p target/release
ln -s ${blink-fuzzy-lib}/lib/libblink_cmp_fuzzy.${libExt} target/release/libblink_cmp_fuzzy.${libExt}
'';
};
};
buildConfigPlugins = plugins: