forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vimPlugins.avante-nvim: move out to separate directory (NixOS#364001)
- Loading branch information
Showing
4 changed files
with
88 additions
and
73 deletions.
There are no files selected for viewing
87 changes: 87 additions & 0 deletions
87
pkgs/applications/editors/vim/plugins/avante-nvim/default.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters