helix: add aichat
This commit is contained in:
parent
57f5b0a4e2
commit
fe22704b14
@ -1,4 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
{ pkgs, lib, stdenv, ... }:
|
||||
|
||||
let
|
||||
actualPkgs = pkgs.unstablePkgs;
|
||||
@ -17,6 +17,24 @@ let
|
||||
bash-language-server
|
||||
pyright
|
||||
];
|
||||
aichatConfigDir = "$HOME/.config/aichat";
|
||||
aichatConfig = ''
|
||||
model: ollama
|
||||
clients:
|
||||
- type: ollama
|
||||
api_base: https://ollama.giugl.io
|
||||
api_key: null
|
||||
models:
|
||||
- name: pino-fast
|
||||
max_input_tokens: null
|
||||
'';
|
||||
aichatRoles = ''
|
||||
- name: comment
|
||||
prompt: >
|
||||
As a helpful assistant designed to assist in documenting code, your primary task is to review the provided code and add clear, concise comments and documentation that will help other developers understand its purpose, functionality, and implementation details. Your comments should be written using language-specific conventions, such as docstrings for Python or Javadoc for Java, to ensure compatibility and maximize their utility for users of different programming languages.
|
||||
When adding comments, focus on conveying essential information about the code, including its inputs, outputs, and behavior, but avoid getting bogged down in unnecessary detail. Your goal is to provide enough context and explanation to allow a competent developer to understand how the code works and how to use it effectively, without overwhelming them with irrelevant or overly technical information.
|
||||
UNDER NO CIRCUMSTANCES should you modify the code itself. Your role is purely to document and explain the code as it currently exists, not to make changes or suggest improvements. By focusing on providing high-quality documentation, you can help ensure that the code is easy to understand, use, and maintain, even as it evolves over time.
|
||||
'';
|
||||
in
|
||||
{
|
||||
home = {
|
||||
@ -39,9 +57,11 @@ in
|
||||
sessionVariables = {
|
||||
EDITOR = "hx";
|
||||
VISUAL = "hx";
|
||||
AICHAT_CONFIG_DIR = aichatConfigDir;
|
||||
};
|
||||
|
||||
file.".config/helix/config.toml".text = ''
|
||||
file = {
|
||||
".config/helix/config.toml".text = ''
|
||||
theme = "monokai_pro_spectrum"
|
||||
|
||||
[editor]
|
||||
@ -63,32 +83,13 @@ in
|
||||
[editor.statusline]
|
||||
left = ["mode", "spinner"]
|
||||
center = ["file-name"]
|
||||
|
||||
[keys.select.l]
|
||||
c = ":pipe ${pkgs.unstablePkgs.aichat}/bin/aichat -c -r comment"
|
||||
'';
|
||||
|
||||
file.".config/helix/languages.toml".text = ''
|
||||
[[language]]
|
||||
name = "nix"
|
||||
formatter = { command = "nixpkgs-fmt" }
|
||||
|
||||
[[language]]
|
||||
name = "python"
|
||||
formatter = { command = "black", args = [ "-" ] }
|
||||
language-servers = [ {name = "pyright"}, {name = "ruff-lsp"}, ]
|
||||
|
||||
[language-server.pyright]
|
||||
command = "pyright-langserver"
|
||||
args = ["--stdio"]
|
||||
config = {}
|
||||
|
||||
[language-server.ruff-lsp]
|
||||
command = "ruff-lsp"
|
||||
args = []
|
||||
config = {}
|
||||
|
||||
[[language]]
|
||||
name = "bash"
|
||||
indent = { tab-width = 2, unit = " " }
|
||||
formatter = { command = 'shfmt', args = ["-i", "2"] }
|
||||
'';
|
||||
"${aichatConfigDir}/roles.yaml".text = aichatRoles;
|
||||
"${aichatConfigDir}/config.yaml".text = aichatConfig;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user