mistral-vibe: add module
This commit is contained in:
parent
a913ae61bf
commit
436b27742c
6 changed files with 126 additions and 0 deletions
10
modules/misc/news/2026/02/2026-02-17_15-42-25.nix
Normal file
10
modules/misc/news/2026/02/2026-02-17_15-42-25.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
time = "2026-02-17T14:42:25+00:00";
|
||||
condition = true;
|
||||
message = ''
|
||||
|
||||
A new module is available: 'programs.mistral-vibe'.
|
||||
|
||||
mistral-vibe is Mistral's open-source CLI coding assistant.
|
||||
'';
|
||||
}
|
||||
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;
|
||||
};
|
||||
}
|
||||
|
|
@ -104,6 +104,7 @@ let
|
|||
"mergiraf"
|
||||
"micro"
|
||||
"mise"
|
||||
"mistral-vibe"
|
||||
"mpv"
|
||||
"msmtp"
|
||||
"mu"
|
||||
|
|
|
|||
1
tests/modules/programs/mistral-vibe/default.nix
Normal file
1
tests/modules/programs/mistral-vibe/default.nix
Normal file
|
|
@ -0,0 +1 @@
|
|||
{ mistral-vibe-program = ./mistral-vibe.nix; }
|
||||
16
tests/modules/programs/mistral-vibe/expected.toml
Normal file
16
tests/modules/programs/mistral-vibe/expected.toml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
active_model = "tracer-vibe"
|
||||
|
||||
[[models]]
|
||||
alias = "tracer-vibe"
|
||||
input_price = 0.0
|
||||
name = "mistralai/devstral-2512:free"
|
||||
output_price = 0.0
|
||||
provider = "tracer-proxy"
|
||||
temperature = 0.1
|
||||
|
||||
[[providers]]
|
||||
api_base = "http://tracer:8081/proxy"
|
||||
api_key_env_var = "OPENROUTER_API_KEY"
|
||||
api_style = "openai"
|
||||
backend = "generic"
|
||||
name = "tracer-proxy"
|
||||
34
tests/modules/programs/mistral-vibe/mistral-vibe.nix
Normal file
34
tests/modules/programs/mistral-vibe/mistral-vibe.nix
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
programs.mistral-vibe = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
active_model = "tracer-vibe";
|
||||
|
||||
providers = [
|
||||
{
|
||||
name = "tracer-proxy";
|
||||
api_base = "http://tracer:8081/proxy";
|
||||
api_key_env_var = "OPENROUTER_API_KEY";
|
||||
api_style = "openai";
|
||||
backend = "generic";
|
||||
}
|
||||
];
|
||||
models = [
|
||||
{
|
||||
name = "mistralai/devstral-2512:free";
|
||||
provider = "tracer-proxy";
|
||||
alias = "tracer-vibe";
|
||||
temperature = 0.1;
|
||||
input_price = 0.0;
|
||||
output_price = 0.0;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.vibe/config.toml
|
||||
assertFileContent home-files/.vibe/config.toml ${./expected.toml}
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue