dotfiles/modules/programs/nvim/new_plugins/avante.nix

42 lines
1,020 B
Nix
Raw Normal View History

2024-10-24 20:32:29 +02:00
{ config, lib, pkgs, ... }:
let
2024-10-24 20:32:29 +02:00
inherit (lib) mkIf;
cfg = config.my.ai;
in
{
2024-10-24 20:32:29 +02:00
config = mkIf cfg.enable {
home-manager.users.moritz.programs.nixvim = {
extraPlugins = with pkgs.vimPlugins; [
nui-nvim
render-markdown-nvim
avante-nvim
];
extraConfigLuaPost = ''
require("render-markdown").setup({ file_types = {"markdown", "Avante"} })
2024-10-08 09:42:32 +02:00
2024-10-24 20:32:29 +02:00
require("avante_lib").load()
require("avante").setup({
provider = "openai",
auto_suggestions_provider = "openai",
behaviour = {
-- auto_suggestions = true,
},
openai = {
model = "gpt-4o",
api_key_name = "cmd:cat /run/agenix/openai"
}
})
'';
plugins.dressing.enable = true;
};
age.secrets = {
"openai".file = ../../../../secrets/openai.age;
"openai".owner = "moritz";
anthropic.file = ../../../../secrets/anthropic.age;
anthropic.owner = "moritz";
};
};
}