mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-06-24 05:23:26 +00:00
plugins/utility/fff-nvim: add fff.nvim module
Adds fff.nvim, a high-performance Rust-backed file picker for Neovim with fuzzy search and frecency scoring. The Rust shared library is built from source via rustPlatform.buildRustPackage and symlinked into target/release/ where the plugin's lua loader expects it. Toggle with vim.utility.fff-nvim.enable; pass arbitrary fff.setup() options through vim.utility.fff-nvim.setupOpts.
This commit is contained in:
parent
a6f49d9a4e
commit
10aa76214c
7 changed files with 184 additions and 1 deletions
58
flake/pkgs/by-name/fff-nvim/package.nix
Normal file
58
flake/pkgs/by-name/fff-nvim/package.nix
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
{
|
||||
lib,
|
||||
pins,
|
||||
rustPlatform,
|
||||
stdenv,
|
||||
vimUtils,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
pin = pins.fff-nvim;
|
||||
|
||||
pname = "fff-nvim-lib";
|
||||
version = pin.revision;
|
||||
src = pkgs.fetchFromGitHub {
|
||||
inherit (pin.repository) owner repo;
|
||||
rev = pin.revision;
|
||||
sha256 = pin.hash;
|
||||
};
|
||||
|
||||
fff-nvim-lib = rustPlatform.buildRustPackage {
|
||||
inherit pname version src;
|
||||
|
||||
cargoLock = {
|
||||
lockFile = "${src}/Cargo.lock";
|
||||
};
|
||||
|
||||
cargoBuildFlags = ["-p" "fff-nvim"];
|
||||
cargoTestFlags = ["-p" "fff-nvim"];
|
||||
|
||||
doCheck = false;
|
||||
|
||||
env.RUSTFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-C link-arg=-undefined -C link-arg=dynamic_lookup";
|
||||
};
|
||||
in
|
||||
vimUtils.buildVimPlugin {
|
||||
pname = "fff-nvim";
|
||||
inherit version src;
|
||||
|
||||
doCheck = false;
|
||||
|
||||
postInstall = let
|
||||
ext = stdenv.hostPlatform.extensions.sharedLibrary;
|
||||
in ''
|
||||
mkdir -p $out/target/release
|
||||
ln -s ${fff-nvim-lib}/lib/libfff_nvim${ext} $out/target/release/libfff_nvim${ext}
|
||||
'';
|
||||
|
||||
nvimSkipModules = [
|
||||
"fff.download"
|
||||
];
|
||||
|
||||
meta = {
|
||||
description = "A high-performance Neovim file picker with fuzzy search and frecency scoring";
|
||||
homepage = "https://github.com/dmtrKovalenko/fff";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = [];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue