mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 18:31:35 +00:00

Change the options to use mkOption when applicable and apply changes to descriptions Change the building of the vimPlugin to use npin dependencies instead of dependencies from nixpkgs
80 lines
1.9 KiB
Nix
80 lines
1.9 KiB
Nix
{
|
|
nix-update-script,
|
|
openssl,
|
|
pkg-config,
|
|
rustPlatform,
|
|
stdenv,
|
|
vimPlugins,
|
|
vimUtils,
|
|
makeWrapper,
|
|
pkgs,
|
|
version,
|
|
src,
|
|
pins,
|
|
}: 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 =
|
|
[vimPlugins.nvim-treesitter]
|
|
++ (builtins.map (name: let
|
|
pin = pins.${name};
|
|
in
|
|
pkgs.fetchFromGitHub {
|
|
inherit (pin.repository) owner repo;
|
|
rev = pin.revision;
|
|
sha256 = pin.hash;
|
|
}) [
|
|
"dressing-nvim"
|
|
"plenary-nvim"
|
|
"nui-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}
|
|
'';
|
|
|
|
nvimSkipModules = [
|
|
# Requires setup with corresponding provider
|
|
"avante.providers.azure"
|
|
"avante.providers.copilot"
|
|
"avante.providers.vertex_claude"
|
|
"avante.providers.ollama"
|
|
];
|
|
}
|