feat(nvim): move avante to own file and use openai

This commit is contained in:
Moritz Böhme 2024-09-15 15:31:39 +02:00
parent 1aa1714237
commit 9a66c10241
Signed by: moritz
GPG key ID: 970C6E89EB0547A9
4 changed files with 35 additions and 21 deletions

View file

@ -0,0 +1,33 @@
{ config, lib, pkgs, inputs, ... }:
let
inherit (lib) mkEnableOption mkIf readFile;
in
{
home-manager.users.moritz.programs.nixvim = {
extraPlugins = [
(pkgs.vimUtils.buildVimPlugin {
pname = "avante.nvim";
src = inputs.avante-nvim;
version = lib.my.mkVersionInput inputs.avante-nvim;
})
pkgs.vimPlugins.nui-nvim
];
extraConfigLuaPost = ''
require("avante").setup({
provider = "openai",
auto_suggestions_provider = "openai",
openai = {
api_key_name = "cmd:cat /run/agenix/openai"
}
})
'';
plugins.copilot-lua.enable = true;
plugins.copilot-lua.suggestion.enabled = false;
plugins.copilot-lua.panel.enabled = false;
plugins.dressing.enable = true;
performance.combinePlugins.standalonePlugins = [ "copilot.lua" ];
};
age.secrets."openai".file = ../../../../secrets/openai.age;
age.secrets."openai".owner = "moritz";
}

View file

@ -145,27 +145,7 @@ in
{ plugins.friendly-snippets.enable = true; }
{ plugins.direnv.enable = true; }
{ plugins.crates-nvim.enable = true; }
{
extraPlugins = [
(pkgs.vimUtils.buildVimPlugin {
pname = "avante.nvim";
src = inputs.avante-nvim;
version = lib.my.mkVersionInput inputs.avante-nvim;
})
pkgs.vimPlugins.nui-nvim
];
extraConfigLuaPost = ''
require("avante").setup({
provider = "copilot",
auto_suggestions_provider = "copilot",
})
'';
plugins.copilot-lua.enable = true;
plugins.copilot-lua.suggestion.enabled = false;
plugins.copilot-lua.panel.enabled = false;
plugins.dressing.enable = true;
performance.combinePlugins.standalonePlugins = [ "copilot.lua" ];
}
];
};
}

BIN
secrets/openai.age Normal file

Binary file not shown.

View file

@ -26,4 +26,5 @@ in
"root-password.age".publicKeys = personal;
"moritz-password.age".publicKeys = personal;
"exercism.age".publicKeys = personal;
"openai.age".publicKeys = personal;
}