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

@ -0,0 +1,10 @@
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBaSks4cFV6RUtIc1RWRVV2
TDN5S3FwNUkwTFUzV3RKdG5HeEQxcE1peTBnCjJQakNZajhGNjlEUGN3RDloa1Vx
dXVJL294Qmprck16bFZQU0h4Y0VpOFEKLS0tIGtpMUNyUWdLZFpMQWZ4cXY2V2pN
UEVKZHhlVE80WTRmVHRJRXI5WTJZSzAKNukDEfztHBWdTul0IxdPc6TKG7Fyw1qt
FItsAZuO2Vgnj0ND0d4Y4SwQaELxS8GsmCc0YHa3LH/GaCrrdRoOpFfTLl3RhzCS
NZpPZp6DETx0HNacYVc/TMOnJsh8TWxJfi5SEnR9Q2YE/406v7MFytF1jybKx2zk
SC2IOCFtcjffUfF+voE/P7CC4xJvCk3XBC74UQqGCEhtXb7yxgIChNV9ik7wwoSZ
xw==
-----END AGE ENCRYPTED FILE-----

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

View file

@ -1,104 +0,0 @@
[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"}
gpt = {command = "helix-gpt", args = ["--handler", "copilot"]}
lsp_ai = {command = "lsp-ai", args = ["--use-seperate-log-file"]}
[[language]]
name = "fish"
scope = "source.fish"
auto-format = true
language-servers = [{ name = "fish_lsp" }]
[[language]]
name = "meson"
scope = "source.meson"
injection-regex = "meson"
#file-types = [{ glob = "meson.build" }, { glob = "meson_options.txt" }]
comment-token = "#"
indent = { tab-width = 2, unit = " " }
auto-format = true
formatter = {command = "muon", args = ["fmt", "-"]}
[[language]]
name = "nix"
scope = "source.nix"
#file-types = ["nix"]
auto-format = true
formatter = { command = "alejandra", args = ["-q"] }
[[language]]
name = "cpp"
language-servers = [
"clangd",
"gpt"
]
[[language]]
name = "python"
language-servers = [
"ruff",
"basedpyright",
"gpt",
]
[[language]]
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"} ]
[[grammar]]
name = "objc"
source = { git = "https://github.com/tree-sitter-grammars/tree-sitter-objc", rev = "18802acf31d0b5c1c1d50bdbc9eb0e1636cab9ed" }
[[language]]
name = "slang"
scope = "source.slang"
file-types = ["slang"]
auto-format = true
language-servers = [{name = "slangd"}]
comment-token = "//"
[[grammar]]
name = "slang"
source = { git = "https://github.com/tree-sitter-grammars/tree-sitter-slang", rev = "3ed23c04a412a0559162d9cadf96dfff7cb36079" }
##################
### BiomeJS Setup
##################
[[language]]
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"] }
[[language]]
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"] }
[[language]]
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"] }
[[language]]
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"] }
[[language]]
name = "json"
language-servers = [ { name = "vscode-json-language-server", except-features = [ "format" ] }, "biome" ]