vimPlugins.avante-nvim: move out to separate directory

Similarly to `vimPlugins.blink-cmp`. This is done to remove manual
intervention in vimPlugins update process.
This commit is contained in:
PerchunPak 2024-12-10 19:05:50 +01:00
parent 9ad61cfc19
commit 2440ed4019
No known key found for this signature in database
GPG Key ID: 313F67D1EAB770F9
4 changed files with 88 additions and 73 deletions

View File

@ -0,0 +1,87 @@
{
lib,
fetchFromGitHub,
nix-update-script,
openssl,
pkg-config,
rustPlatform,
stdenv,
vimPlugins,
vimUtils,
}:
let
version = "0.0.12";
src = fetchFromGitHub {
owner = "yetone";
repo = "avante.nvim";
tag = "v${version}";
hash = "sha256-yFHX9WCdTBtFZ2Yhy542Rg9nyIu6IWyRjKkS+ojZsdM=";
};
avante-nvim-lib = rustPlatform.buildRustPackage {
pname = "avante-nvim-lib";
inherit version src;
cargoHash = "sha256-n0+UT9wYnmPDOX2LKWztURqYLy2oa8sUeQLycR3/Zr0=";
nativeBuildInputs = [
pkg-config
];
buildInputs = [
openssl
];
buildFeatures = [ "luajit" ];
checkFlags = [
# Disabled because they access the network.
"--skip=test_hf"
"--skip=test_public_url"
"--skip=test_roundtrip"
];
};
in
vimUtils.buildVimPlugin {
pname = "avante-nvim";
inherit version src;
dependencies = with vimPlugins; [
dressing-nvim
nui-nvim
nvim-treesitter
plenary-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}
'';
passthru = {
updateScript = nix-update-script {
attrPath = "vimPlugins.avante-nvim.avante-nvim-lib";
};
# needed for the update script
inherit avante-nvim-lib;
};
doInstallCheck = true;
nvimRequireCheck = "avante";
meta = {
description = "Neovim plugin designed to emulate the behaviour of the Cursor AI IDE";
homepage = "https://github.com/yetone/avante.nvim";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [
ttrei
aarnphm
];
};
}

View File

@ -1025,18 +1025,6 @@ final: prev:
meta.homepage = "https://github.com/nullishamy/autosave.nvim/";
};
avante-nvim = buildVimPlugin {
pname = "avante.nvim";
version = "2024-12-05";
src = fetchFromGitHub {
owner = "yetone";
repo = "avante.nvim";
rev = "4464b7f4ae26254cd506a354284a02129941e244";
sha256 = "0h1l3d332hh3gbdwydmm5wpswfzcl7w9j0bx6g6xnazya5cpzc3s";
};
meta.homepage = "https://github.com/yetone/avante.nvim/";
};
aw-watcher-vim = buildVimPlugin {
pname = "aw-watcher-vim";
version = "2023-10-09";

View File

@ -197,66 +197,7 @@ in
];
};
avante-nvim = super.avante-nvim.overrideAttrs (
oldAttrs:
let
avante-nvim-lib = rustPlatform.buildRustPackage {
pname = "avante-nvim-lib";
inherit (oldAttrs) version src;
cargoHash = "sha256-kbgJlvYtL69i6br5jQ9QiCXEQuOWiHRDFWAofyKJb2s=";
nativeBuildInputs = [
pkg-config
];
buildInputs = [
openssl
];
buildFeatures = [ "luajit" ];
checkFlags = [
# Disabled because they access the network.
"--skip=test_hf"
"--skip=test_public_url"
"--skip=test_roundtrip"
];
};
in
{
dependencies = with self; [
dressing-nvim
nui-nvim
nvim-treesitter
plenary-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}
'';
doInstallCheck = true;
nvimRequireCheck = "avante";
meta = {
description = "Neovim plugin designed to emulate the behaviour of the Cursor AI IDE";
homepage = "https://github.com/yetone/avante.nvim";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [
ttrei
aarnphm
];
};
}
);
avante-nvim = callPackage ./avante-nvim { };
aw-watcher-vim = super.aw-watcher-vim.overrideAttrs {
patches = [

View File

@ -84,7 +84,6 @@ https://github.com/m4xshen/autoclose.nvim/,HEAD,
https://github.com/gaoDean/autolist.nvim/,,
https://github.com/vim-scripts/autoload_cscope.vim/,,
https://github.com/nullishamy/autosave.nvim/,HEAD,
https://github.com/yetone/avante.nvim/,HEAD,
https://github.com/rafi/awesome-vim-colorschemes/,,
https://github.com/AhmedAbdulrahman/aylin.vim/,,
https://github.com/ayu-theme/ayu-vim/,,