Skip to content

Commit

Permalink
blink: expose blink package
Browse files Browse the repository at this point in the history
  • Loading branch information
horriblename committed Jan 1, 2025
1 parent 18e4810 commit 4d88661
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
4 changes: 4 additions & 0 deletions flake/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
...
}: let
docs = import ../docs {inherit pkgs inputs lib;};
pluginVersion = input: input.shortRev or input.shortDirtyRev or "dirty";
in {
packages = {
inherit (docs.manual) htmlOpenTool;
Expand Down Expand Up @@ -66,6 +67,9 @@
Volumes = {"/home/neovim/demo" = {};};
};
};

# Plugins that need a compile step
blink-cmp = pkgs.callPackage ./packages/blink-cmp.nix {};
};
};
}
43 changes: 43 additions & 0 deletions flake/packages/blink-cmp.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
rustPlatform,
hostPlatform,
fetchFromGitHub,
vimUtils,
}: let
version = "6891bcb06b6f21de68278991f29e53452b822d48";

src = fetchFromGitHub {
owner = "saghen";
repo = "blink.cmp";
rev = version;
hash = "sha256-gBu2NG7olejMq895+xrqGiQBDS+6EJFL7QD7mujlHUg=";
};

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;
};
cargoLock = {
lockFile = "${src}/Cargo.lock";
outputHashes = {
"frizbee-0.1.0" = "sha256-pt6sMsRyjXrbrTK7t/YvWeen/n3nU8UUaiNYTY1LczE=";
};
};
};
libExt =
if hostPlatform.isDarwin
then "dylib"
else "so";
in
vimUtils.buildVimPlugin {
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}
'';
}

0 comments on commit 4d88661

Please sign in to comment.