mistral-vibe: add module
This commit is contained in:
parent
a913ae61bf
commit
436b27742c
6 changed files with 126 additions and 0 deletions
64
modules/programs/mistral-vibe.nix
Normal file
64
modules/programs/mistral-vibe.nix
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
|
||||
cfg = config.programs.mistral-vibe;
|
||||
|
||||
settingsFormat = pkgs.formats.toml { };
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = [ lib.maintainers.GaetanLepage ];
|
||||
|
||||
options.programs.mistral-vibe = {
|
||||
enable = lib.mkEnableOption "Mistral Vibe, Mistral's open-source CLI coding assistant";
|
||||
|
||||
package = lib.mkPackageOption pkgs "mistral-vibe" { nullable = true; };
|
||||
|
||||
settings = lib.mkOption {
|
||||
type = settingsFormat.type;
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
active_model = "devstral-latest";
|
||||
vim_keybindings = false;
|
||||
tool_paths = [];
|
||||
|
||||
providers = [
|
||||
{
|
||||
name = "mistral";
|
||||
backend = "mistral";
|
||||
api_base = "https://api.mistral.ai/v1";
|
||||
api_key_env_var = "MISTRAL_API_KEY";
|
||||
api_style = "openai";
|
||||
}
|
||||
];
|
||||
|
||||
models = [
|
||||
{
|
||||
name = "devstral-latest";
|
||||
provider = "mistral";
|
||||
alias = "devstral-latest";
|
||||
temperature = 0.1;
|
||||
input_price = 0.4;
|
||||
output_price = 2.0;
|
||||
}
|
||||
];
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Mistral Vibe configuration.
|
||||
For available settings see <https://github.com/mistralai/mistral-vibe>.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
|
||||
home.file.".vibe/config.toml".source = settingsFormat.generate "config.toml" cfg.settings;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue