From a66f932a8f00418d6e7bca088347c33d36076d78 Mon Sep 17 00:00:00 2001 From: Ellis Rahhal Date: Fri, 28 Feb 2025 12:03:09 -0800 Subject: [PATCH] minor tweaks --- autocmd.nix | 2 +- flake.lock | 166 ++------------------------------------ plugins/avante-custom.nix | 38 ++++----- plugins/avante.nix | 9 +++ plugins/default.nix | 4 +- 5 files changed, 39 insertions(+), 180 deletions(-) diff --git a/autocmd.nix b/autocmd.nix index 30968c7..d4805ee 100644 --- a/autocmd.nix +++ b/autocmd.nix @@ -64,7 +64,7 @@ __raw = '' function() vim.cmd([[ - if &ft =~ 'javascript\|html\|jade\|json\|css\|less\|php\|python\|sh\|c\|cpp\|markdown\|yaml\|vim\|nix' + if &ft =~ 'javascript\|html\|jade\|json\|css\|less\|php\|python\|sh\|c\|cpp\|markdown\|yaml\|vim\|nix|graphql' :%s/\s\+$//e elseif expand('%:t') =~ '\.gltf$' || expand('%:t') =~ '\.glsl$' :%s/\s\+$//e diff --git a/flake.lock b/flake.lock index 3653bb4..41fe053 100644 --- a/flake.lock +++ b/flake.lock @@ -1,40 +1,5 @@ { "nodes": { - "devshell": { - "inputs": { - "nixpkgs": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1735644329, - "narHash": "sha256-tO3HrHriyLvipc4xr+Ewtdlo7wM1OjXNjlWRgmM7peY=", - "owner": "numtide", - "repo": "devshell", - "rev": "f7795ede5b02664b57035b3b757876703e2c3eac", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "devshell", - "type": "github" - } - }, - "flake-compat": { - "locked": { - "lastModified": 1733328505, - "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", - "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", - "revCount": 69, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.1.0/01948eb7-9cba-704f-bbf3-3fa956735b52/source.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" - } - }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -74,75 +39,6 @@ "type": "github" } }, - "git-hooks": { - "inputs": { - "flake-compat": [ - "nixvim", - "flake-compat" - ], - "gitignore": "gitignore", - "nixpkgs": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1737465171, - "narHash": "sha256-R10v2hoJRLq8jcL4syVFag7nIGE7m13qO48wRIukWNg=", - "owner": "cachix", - "repo": "git-hooks.nix", - "rev": "9364dc02281ce2d37a1f55b6e51f7c0f65a75f17", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "git-hooks.nix", - "type": "github" - } - }, - "gitignore": { - "inputs": { - "nixpkgs": [ - "nixvim", - "git-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1709087332, - "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, - "home-manager": { - "inputs": { - "nixpkgs": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1738878603, - "narHash": "sha256-fmhq8B3MvQLawLbMO+LWLcdC2ftLMmwSk+P29icJ3tE=", - "owner": "nix-community", - "repo": "home-manager", - "rev": "433799271274c9f2ab520a49527ebfe2992dcfbd", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "home-manager", - "type": "github" - } - }, "ixx": { "inputs": { "flake-utils": [ @@ -171,34 +67,13 @@ "type": "github" } }, - "nix-darwin": { - "inputs": { - "nixpkgs": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1738743987, - "narHash": "sha256-O3bnAfsObto6l2tQOmQlrO6Z2kD6yKwOWfs7pA0CpOc=", - "owner": "lnl7", - "repo": "nix-darwin", - "rev": "ae406c04577ff9a64087018c79b4fdc02468c87c", - "type": "github" - }, - "original": { - "owner": "lnl7", - "repo": "nix-darwin", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1740126099, - "narHash": "sha256-ozoOtE2hGsqh4XkTJFsrTkNxkRgShxpQxDynaPZUGxk=", + "lastModified": 1740560979, + "narHash": "sha256-Vr3Qi346M+8CjedtbyUevIGDZW8LcA1fTG0ugPY/Hic=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "32fb99ba93fea2798be0e997ea331dd78167f814", + "rev": "5135c59491985879812717f4c9fea69604e7f26f", "type": "github" }, "original": { @@ -226,22 +101,16 @@ }, "nixvim": { "inputs": { - "devshell": "devshell", - "flake-compat": "flake-compat", "flake-parts": "flake-parts", - "git-hooks": "git-hooks", - "home-manager": "home-manager", - "nix-darwin": "nix-darwin", "nixpkgs": "nixpkgs_2", - "nuschtosSearch": "nuschtosSearch", - "treefmt-nix": "treefmt-nix" + "nuschtosSearch": "nuschtosSearch" }, "locked": { - "lastModified": 1739902813, - "narHash": "sha256-BgOQcKKz7VNvSHIbBllHisv32HvF3W3ALF9sdnC++V8=", + "lastModified": 1740520037, + "narHash": "sha256-TpZMYjOre+6GhKDVHFwoW2iBWqpNQppQTuqIAo+OBV8=", "owner": "nix-community", "repo": "nixvim", - "rev": "0ab9947137cd034ec64eb5cd9ede94e53af21f50", + "rev": "6f8d8f7aee84f377f52c8bb58385015f9168a666", "type": "github" }, "original": { @@ -293,27 +162,6 @@ "repo": "default", "type": "github" } - }, - "treefmt-nix": { - "inputs": { - "nixpkgs": [ - "nixvim", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1738680491, - "narHash": "sha256-8X7tR3kFGkE7WEF5EXVkt4apgaN85oHZdoTGutCFs6I=", - "owner": "numtide", - "repo": "treefmt-nix", - "rev": "64dbb922d51a42c0ced6a7668ca008dded61c483", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "treefmt-nix", - "type": "github" - } } }, "root": "root", diff --git a/plugins/avante-custom.nix b/plugins/avante-custom.nix index e096cf8..00be911 100644 --- a/plugins/avante-custom.nix +++ b/plugins/avante-custom.nix @@ -2,30 +2,32 @@ { programs.nixvim = if config.nixvim-config.enable-ai then { extraPlugins = [ - pkgs.vimPlugins.avante-nvim - # (pkgs.vimUtils.buildVimPlugin { - # name = "avante"; - # src = pkgs.fetchFromGitHub { - # owner = "yetone"; - # repo = "avante.nvim"; - # rev = "v0.0.19"; - # hash = "sha256-/WvkMsyhaYa3TLOg6QBVz1dvHO4vr1PdeSF7zVIOUcY="; - # }; - # }) + (pkgs.vimUtils.buildVimPlugin { + name = "avante-nvim"; + src = pkgs.fetchFromGitHub { + owner = "yetone"; + repo = "avante.nvim"; + rev = "984fe877bfee4cf26e1e5f7e13cc284b6f26bc10"; + hash = "sha256-nSXY7qwXuZsc7qGnqXTpLZZFLshzckwVBmq3TWbwLFY="; + }; + }) + pkgs.vimPlugins.dressing-nvim + pkgs.vimPlugins.nui-nvim + pkgs.vimPlugins.plenary-nvim ]; # Use "post" to make sure dependencies are loaded first - extraConfigLuaPost = '' - -- MunifTanjim/nui.nvim - -- stevearc/dressing.nvim - -- nvim-lua/plenary.nvim - - require('nui').setup({}); - require('dressing').setup({}); - require('plenary').setup({}); + extraConfigLua = '' + require('nui') + require('dressing') + require('plenary') require('avante_lib').load() require('avante').setup ({ provider = "copilot", + cursor_applying_provider = "copilot", + behaviour = { + enable_cursor_planning_mode = true, + }, claude = { api_key_name = "", diff --git a/plugins/avante.nix b/plugins/avante.nix index cd3a319..02def44 100644 --- a/plugins/avante.nix +++ b/plugins/avante.nix @@ -23,6 +23,15 @@ enable_cursor_planning_mode = true; }; + web_search_engine = { + provider = "tavily"; # tavily, serpapi, searchapi, google, kagi + }; + + # depends on docker + rag_service = { + enable = false; # requires OPENAI_API_KEY to be set + }; + files = { auto_include = true; # Automatically include relevant files max_files = 50; # Maximum number of files to include in context diff --git a/plugins/default.nix b/plugins/default.nix index 98b9ed2..a277a6c 100644 --- a/plugins/default.nix +++ b/plugins/default.nix @@ -33,7 +33,7 @@ plugins = { comment.enable = true; ## needed by avante. already archived, so may need to migrate to snacks - dressing.enable = true; + # dressing.enable = true; fugitive.enable = true; gitsigns.enable = true; lightline.enable = false; @@ -49,7 +49,7 @@ }; }; ## needed by avante. - nui.enable = true; + # nui.enable = true; nvim-autopairs.enable = true; nvim-bqf.enable = true; nvim-lightbulb.enable = true;