avante and remote sshfs

This commit is contained in:
RingOfStorms (Joshua Bell) 2024-11-14 13:40:28 -06:00
parent 0799ca73d0
commit 615c53c8fb
6 changed files with 210 additions and 49 deletions

View file

@ -108,10 +108,10 @@
"nvim_plugin-zbirenbaum/copilot.lua".flake = false;
"nvim_plugin-CopilotC-Nvim/CopilotChat.nvim".url = "github:CopilotC-Nvim/CopilotChat.nvim";
"nvim_plugin-CopilotC-Nvim/CopilotChat.nvim".flake = false;
# "nvim_plugin-yetone/avante.nvim".url = "github:yetone/avante.nvim";
# "nvim_plugin-yetone/avante.nvim".flake = false;
# "nvim_plugin-stevearc/dressing.nvim".url = "github:stevearc/dressing.nvim";
# "nvim_plugin-stevearc/dressing.nvim".flake = false;
"nvim_plugin-yetone/avante.nvim".url = "github:yetone/avante.nvim";
"nvim_plugin-yetone/avante.nvim".flake = false;
"nvim_plugin-stevearc/dressing.nvim".url = "github:stevearc/dressing.nvim";
"nvim_plugin-stevearc/dressing.nvim".flake = false;
"nvim_plugin-folke/neodev.nvim".url = "github:folke/neodev.nvim";
"nvim_plugin-folke/neodev.nvim".flake = false;
"nvim_plugin-mrcjkb/rustaceanvim".url = "github:mrcjkb/rustaceanvim";
@ -124,6 +124,8 @@
"nvim_plugin-rafamadriz/friendly-snippets".flake = false;
"nvim_plugin-ron/ron.vim".url = "github:ron-rs/ron.vim";
"nvim_plugin-ron/ron.vim".flake = false;
"nvim_plugin-nosduco/remote-sshfs.nvim".url = "github:nosduco/remote-sshfs.nvim";
"nvim_plugin-nosduco/remote-sshfs.nvim".flake = false;
};
outputs =
{
@ -165,6 +167,44 @@
"nvim_plugin-nvim-treesitter/nvim-treesitter" = nvim-treesitter.withAllGrammars;
};
avante-nvim-lib = pkgs.rustPlatform.buildRustPackage {
pname = "avante-nvim-lib";
version = "0.0.0";
src = inputs."nvim_plugin-yetone/avante.nvim";
buildFeatures = [ "luajit" ];
doCheck = false;
cargoLock = {
lockFile = inputs."nvim_plugin-yetone/avante.nvim" + "/Cargo.lock";
allowBuiltinFetchGit = true;
};
nativeBuildInputs = with pkgs; [
pkg-config
];
buildInputs = with pkgs; [
openssl.dev
];
env = {
OPENSSL_NO_VENDOR = "1";
OPENSSL_LIB_DIR = "${pkgs.openssl.out}/lib";
OPENSSL_INCLUDE_DIR = "${pkgs.openssl.dev}/include";
OPENSSL_DIR = "${pkgs.openssl.dev}";
};
postInstall = ''
# mv $out/lib/libavante_repo_map.so $out/lib/avante_repo_map.so
for f in $out/lib/lib*; do
mv "$f" "$out/lib/''${f##*/lib}"
done
'';
meta = {
description = "Avante nvim libraries";
homepage = "https://github.com/yetone/avante.nvim";
license = pkgs.lib.licenses.asl20;
};
};
# This will be how we put any nix related stuff into our lua config
luaNixGlobal =
"NIX="
@ -182,6 +222,7 @@
(builtins.filter (n: builtins.substring 0 12 n == "nvim_plugin-") (builtins.attrNames inputs));
});
# These are appended at the start of the path so that they take precedence over local install tools
runtimeDependencies = with pkgs; [
# tools
ripgrep # search
@ -190,9 +231,11 @@
tree-sitter
glow # markdown renderer
curl # http requests
# nodePackages.cspell TODO
sshfs # remote dev for nosduco/remote-sshfs.nvim
# nodePackages.cspell TODO check out `typos` rust checker instead?
];
# These are appended at the end of the PATH so any local installed tools will take precedence
defaultRuntimeDependencies = with pkgs; [
# linters
markdownlint-cli
@ -261,6 +304,16 @@
"--set"
"LAZY"
"${lazyPath}"
# Link avante libraries
"--prefix"
"LD_LIBRARY_PATH"
":"
"${avante-nvim-lib}/lib"
# Add Lua C modules path
"--prefix"
"LUA_CPATH"
";"
"${avante-nvim-lib}/lib/?.so"
# Don't use default directories to not collide with another neovim config
# All things at runtime should be deletable since we are using nix to handle downloads and bins
# so I've chosen to put everything into the local state directory.