Compare commits
3 commits
28008a1166
...
6a4fe274ef
Author | SHA1 | Date | |
---|---|---|---|
6a4fe274ef | |||
69b56b334d | |||
462a85aac8 |
4 changed files with 60 additions and 3 deletions
|
@ -5,11 +5,11 @@
|
|||
|
||||
services = {
|
||||
avahi = {
|
||||
enable = true;
|
||||
enable = false;
|
||||
nssmdns4 = true;
|
||||
};
|
||||
printing = {
|
||||
enable = true;
|
||||
enable = false;
|
||||
drivers = with pkgs; [ gutenprint cnijfilter2 ];
|
||||
};
|
||||
};
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
|
||||
services.ollama = {
|
||||
enable = true;
|
||||
package = pkgs.ollama;
|
||||
package = pkgs.unstable.ollama;
|
||||
acceleration = "rocm";
|
||||
};
|
||||
|
||||
|
|
56
neovim/plugins/codecompanion.nix
Normal file
56
neovim/plugins/codecompanion.nix
Normal file
|
@ -0,0 +1,56 @@
|
|||
{ lib, config, ... }:
|
||||
|
||||
let
|
||||
inherit (lib.nix2lua) return lambda0 pipe1 require call;
|
||||
|
||||
reqCodeCompanionAdapters = require "codecompanion.adapters";
|
||||
|
||||
mkOllamaAdapter = data:
|
||||
lambda0
|
||||
(return (pipe1
|
||||
reqCodeCompanionAdapters
|
||||
(call "extend" [ "ollama" data ])
|
||||
));
|
||||
|
||||
adapters = {
|
||||
mistral = mkOllamaAdapter {
|
||||
name = "mistral";
|
||||
schema = {
|
||||
model.default = "mistral:7b";
|
||||
num_ctx.default = 16384;
|
||||
num_predict.default = -1;
|
||||
};
|
||||
};
|
||||
codellama = mkOllamaAdapter {
|
||||
name = "codellama";
|
||||
schema = {
|
||||
model.default = "codellama:7b";
|
||||
num_ctx.default = 16384;
|
||||
num_predict.default = -1;
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
# dependencies
|
||||
plugin.plenary-nvim = { };
|
||||
|
||||
plugin.codecompanion-nvim = {
|
||||
enable = true;
|
||||
name = "codecompanion";
|
||||
setupSettings = {
|
||||
inherit adapters;
|
||||
strategies = {
|
||||
chat.adapter = "mistral";
|
||||
inline.adapter = "codellama";
|
||||
cmd.adapter = "codellama";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
plugin.nvim-cmp.setupSettings = lib.mkIf config.plugins.nvim-cmp.enable {
|
||||
sources = {
|
||||
per_filetype.codecompanion = [ "codecompanion" ];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
imports = [
|
||||
./ollama.nix
|
||||
./codecompanion.nix
|
||||
# ./spring-boot.nix
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue