feat(nvim): move avante to own file and use openai
This commit is contained in:
parent
1aa1714237
commit
9a66c10241
4 changed files with 35 additions and 21 deletions
33
modules/programs/nvim/new_plugins/avante.nix
Normal file
33
modules/programs/nvim/new_plugins/avante.nix
Normal 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";
|
||||
}
|
|
@ -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
BIN
secrets/openai.age
Normal file
Binary file not shown.
|
@ -26,4 +26,5 @@ in
|
|||
"root-password.age".publicKeys = personal;
|
||||
"moritz-password.age".publicKeys = personal;
|
||||
"exercism.age".publicKeys = personal;
|
||||
"openai.age".publicKeys = personal;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue