mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-08 03:11:36 +00:00
Merge branch 'main' into avante
use pins for package call syntax fix add optional deps
This commit is contained in:
commit
5fe4106866
97 changed files with 1157 additions and 486 deletions
88
flake/avante-nvim/default.nix
Normal file
88
flake/avante-nvim/default.nix
Normal file
|
@ -0,0 +1,88 @@
|
|||
{
|
||||
nix-update-script,
|
||||
openssl,
|
||||
pkg-config,
|
||||
rustPlatform,
|
||||
stdenv,
|
||||
vimPlugins,
|
||||
vimUtils,
|
||||
makeWrapper,
|
||||
pkgs,
|
||||
version,
|
||||
src,
|
||||
}: let
|
||||
inherit version src;
|
||||
avante-nvim-lib = rustPlatform.buildRustPackage {
|
||||
pname = "avante-nvim-lib";
|
||||
inherit version src;
|
||||
|
||||
useFetchCargoVendor = true;
|
||||
cargoHash = "sha256-pmnMoNdaIR0i+4kwW3cf01vDQo39QakTCEG9AXA86ck=";
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
makeWrapper
|
||||
pkgs.perl
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
openssl
|
||||
];
|
||||
|
||||
buildFeatures = ["luajit"];
|
||||
|
||||
checkFlags = [
|
||||
# Disabled because they access the network.
|
||||
"--skip=test_hf"
|
||||
"--skip=test_public_url"
|
||||
"--skip=test_roundtrip"
|
||||
"--skip=test_fetch_md"
|
||||
];
|
||||
};
|
||||
in
|
||||
vimUtils.buildVimPlugin {
|
||||
pname = "avante-nvim";
|
||||
inherit version src;
|
||||
|
||||
dependencies = with vimPlugins; [
|
||||
nvim-treesitter
|
||||
dressing-nvim
|
||||
plenary-nvim
|
||||
nui-nvim
|
||||
|
||||
# optional, not sure how we best deal with adding these as options for the user to set
|
||||
mini-pick
|
||||
telescope-nvim
|
||||
nvim-cmp
|
||||
fzf-lua
|
||||
nvim-web-devicons
|
||||
img-clip-nvim
|
||||
];
|
||||
|
||||
postInstall = let
|
||||
ext = stdenv.hostPlatform.extensions.sharedLibrary;
|
||||
in ''
|
||||
mkdir -p $out/build
|
||||
ln -s ${avante-nvim-lib}/lib/libavante_repo_map${ext} $out/build/avante_repo_map${ext}
|
||||
ln -s ${avante-nvim-lib}/lib/libavante_templates${ext} $out/build/avante_templates${ext}
|
||||
ln -s ${avante-nvim-lib}/lib/libavante_tokenizers${ext} $out/build/avante_tokenizers${ext}
|
||||
ln -s ${avante-nvim-lib}/lib/libavante_html2md${ext} $out/build/avante_html2md${ext}
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
updateScript = nix-update-script {
|
||||
attrPath = "vimPlugins.avante-nvim.avante-nvim-lib";
|
||||
};
|
||||
|
||||
# needed for the update script
|
||||
inherit avante-nvim-lib;
|
||||
};
|
||||
|
||||
nvimSkipModules = [
|
||||
# Requires setup with corresponding provider
|
||||
"avante.providers.azure"
|
||||
"avante.providers.copilot"
|
||||
"avante.providers.vertex_claude"
|
||||
"avante.providers.ollama"
|
||||
];
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue