Compare commits

..

2 commits

Author SHA1 Message Date
Ching Pei Yang
7b21e10b88
Merge e7cdd3c8a4 into 8febf44422 2025-01-01 09:48:20 +00:00
Ching Pei Yang
e7cdd3c8a4
blink: expose blink package 2025-01-01 10:47:42 +01:00
3 changed files with 31 additions and 33 deletions

View file

@ -6,7 +6,7 @@
...
}: let
docs = import ../docs {inherit pkgs inputs lib;};
pluginVersion = src: src.shortRev or src.shortDirtyRev or "dirty";
pluginVersion = input: input.shortRev or input.shortDirtyRev or "dirty";
in {
packages = {
inherit (docs.manual) htmlOpenTool;
@ -68,7 +68,7 @@
};
};
# Plugins that need compiling
# Plugins that need a compile step
blink-cmp = pkgs.callPackage ./packages/blink-cmp.nix {
src = inputs.plugin-blink-cmp;
version = pluginVersion inputs.plugin-blink-cmp;

View file

@ -1,35 +1,38 @@
{
rustPlatform,
hostPlatform,
vimUtils,
src,
version,
}: let
blink-fuzzy-lib = rustPlatform.buildRustPackage {
pname = "blink-fuzzy-lib";
vimUtils,
}: {
blink-cmp = let
inherit version src;
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=";
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}
'';
}
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}
'';
};
}

View file

@ -45,11 +45,6 @@
pname = "flutter-tools";
patches = [../patches/flutter-tools.patch];
};
blink-cmp = pkgs.callPackage ../../../flake/packages/blink-cmp.nix {
src = inputs.plugin-blink-cmp;
# TODO: extract into helper func
version = inputs.plugin-blink-cmp.shortRev or inputs.plugin-blink-cmp.shortDirtyRev or "dirty";
};
};
buildConfigPlugins = plugins: