Updated helix config to allow for flake based overrides

This commit is contained in:
Tyler Mayoff 2025-11-12 12:09:19 -05:00 committed by Tyle Mayoff
parent 3c172ef9fc
commit 07177c14ca
No known key found for this signature in database
5 changed files with 286 additions and 104 deletions

View file

@ -2,6 +2,177 @@
programs.helix = {
enable = true;
package = pkgs.unstable.helix;
languages = {
language-server = {
clangd = {
command = "clangd";
args = ["--header-insertion=never"];
};
biome = {
command = "biome";
args = ["lsp-proxy"];
};
fish_lsp = {
command = "fish-lsp";
args = ["start"];
};
slangd = {
command = "slangd";
};
};
language = [
{
name = "fish";
scope = "source.fish";
auto-format = true;
language-servers = [{name = "fish_lsp";}];
}
{
name = "meson";
scope = "source.meson";
injection-regex = "meson";
comment-token = "#";
indent = {
tab-width = 2;
unit = " ";
};
auto-format = true;
formatter = {
command = "muon";
args = ["fmt" "-"];
};
}
{
name = "nix";
scope = "source.nix";
auto-format = true;
formatter = {
command = "alejandra";
args = ["-q"];
};
}
{
name = "cpp";
language-servers = ["clangd"];
}
{
name = "python";
language-servers = ["ruff" "basedpyright"];
}
{
name = "objc";
scope = "source.objc";
file-types = ["m" "mm" "M"];
injection-regex = "objc";
roots = ["xcodeproj"];
comment-token = "//";
indent = {
tab-width = 2;
unit = " ";
};
language-servers = [{name = "clangd";}];
}
{
name = "slang";
scope = "source.slang";
file-types = ["slang"];
auto-format = true;
language-servers = [{name = "slangd";}];
comment-token = "//";
}
# BiomeJS Setup
{
name = "javascript";
language-servers = [
{
name = "typescript-language-server";
except-features = ["format"];
}
"biome"
];
auto-format = true;
formatter = {
command = "biome";
args = ["format" "--stdin-file-path" "a.js"];
};
}
{
name = "typescript";
language-servers = [
{
name = "typescript-language-server";
except-features = ["format"];
}
"biome"
];
auto-format = true;
formatter = {
command = "biome";
args = ["format" "--stdin-file-path" "a.ts"];
};
}
{
name = "tsx";
auto-format = true;
language-servers = [
{
name = "typescript-language-server";
except-features = ["format"];
}
"biome"
];
formatter = {
command = "biome";
args = ["format" "--stdin-file-path" "a.tsx"];
};
}
{
name = "jsx";
auto-format = true;
language-servers = [
{
name = "typescript-language-server";
except-features = ["format"];
}
"biome"
];
formatter = {
command = "biome";
args = ["format" "--stdin-file-path" "a.jsx"];
};
}
{
name = "json";
language-servers = [
{
name = "vscode-json-language-server";
except-features = ["format"];
}
"biome"
];
}
];
grammar = [
{
name = "objc";
source = {
git = "https://github.com/tree-sitter-grammars/tree-sitter-objc";
rev = "18802acf31d0b5c1c1d50bdbc9eb0e1636cab9ed";
};
}
{
name = "slang";
source = {
git = "https://github.com/tree-sitter-grammars/tree-sitter-slang";
rev = "3ed23c04a412a0559162d9cadf96dfff7cb36079";
};
}
];
};
settings = {
theme = "base16_terminal";
editor = {

View file

@ -101,6 +101,7 @@ in {
"notunes"
"hammerspoon"
"claude-code"
"firefox"
"gpg-suite"

View file

@ -6,6 +6,107 @@
../../modules/darwin/PaperWM.spoon
];
# Hinge-specific Helix configuration with lsp-ai
programs.helix.languages = {
language-server.lsp_ai = {
command = "lsp-ai";
args = [
"--use-seperate-log-file"
"--stdio"
];
config = {
memory = {
file_store = {};
};
models = {
model1 = {
type = "anthropic";
chat_endpoint = "https://api.anthropic.com/v1/messages";
model = "claude-3-5-haiku-20241022";
auth_token_env_var_name = "ANTHROPIC_API_KEY";
};
};
completion = {
model = "model1";
parameters = {
max_context = 2048;
max_tokens = 50;
system = "You are a code completion assistant. Complete the code at <CURSOR>. Only output the completion itself, nothing else. Be concise.";
messages = [
{
role = "user";
content = "def greet(name):\n print(f\"Hello, {<CURSOR>}\")";
}
{
role = "assistant";
content = "name";
}
{
role = "user";
content = "function sum(a, b) {\n return a + <CURSOR>;\n}";
}
{
role = "assistant";
content = "b";
}
{
role = "user";
content = "fn multiply(a: i32, b: i32) -> i32 {\n a * <CURSOR>\n}";
}
{
role = "assistant";
content = "b";
}
{
role = "user";
content = "# <CURSOR>\ndef add(a, b):\n return a + b";
}
{
role = "assistant";
content = "Adds two numbers";
}
{
role = "user";
content = "# This function checks if a number is even\n<CURSOR>";
}
{
role = "assistant";
content = "def is_even(n):\n return n % 2 == 0";
}
{
role = "user";
content = "{CODE}";
}
];
};
};
};
};
language = [
{
name = "cpp";
language-servers = ["clangd" "lsp_ai"];
}
{
name = "python";
language-servers = ["ruff" "basedpyright" "lsp_ai"];
}
{
name = "typescript";
language-servers = ["typescript-language-server" "lsp_ai"];
}
{
name = "bash";
language-servers = ["bash-language-server" "lsp_ai"];
}
{
name = "toml";
language-servers = ["taplo" "lsp_ai"];
}
];
};
targets.darwin.linkApps.enable = false;
targets.darwin.copyApps.enable = true;
@ -58,6 +159,9 @@
unstable.biome
uv
unstable.jiratui
unstable.opencode
ffmpeg
sccache
just