chore: split up helix into multiple packages
This commit is contained in:
parent
9f925d579b
commit
88c73558f4
4 changed files with 154 additions and 125 deletions
|
@ -2,7 +2,7 @@
|
|||
pkgs,
|
||||
helix,
|
||||
}: let
|
||||
wrapped-helix = pkgs.callPackage ./helix.nix {inherit helix;};
|
||||
wrapped-helix = pkgs.callPackage ./helix {inherit helix;};
|
||||
kakoune = pkgs.callPackage ./kakoune.nix {};
|
||||
fish = pkgs.callPackage ./shell {};
|
||||
in {
|
||||
|
|
0
packages/helix/colorscheme.nix
Normal file
0
packages/helix/colorscheme.nix
Normal file
151
packages/helix/default.nix
Normal file
151
packages/helix/default.nix
Normal file
|
@ -0,0 +1,151 @@
|
|||
{
|
||||
symlinkJoin,
|
||||
makeWrapper,
|
||||
callPackage,
|
||||
alejandra,
|
||||
basedpyright,
|
||||
bash-language-server,
|
||||
clang-tools,
|
||||
clippy,
|
||||
cmake-format,
|
||||
cmake-language-server,
|
||||
deno,
|
||||
dprint,
|
||||
formats,
|
||||
gdb,
|
||||
golangci-lint-langserver,
|
||||
gopls,
|
||||
lazygit,
|
||||
lib,
|
||||
lldb_19,
|
||||
marksman,
|
||||
nil,
|
||||
nixd,
|
||||
ruff,
|
||||
rust-analyzer,
|
||||
rustfmt,
|
||||
shellcheck,
|
||||
shfmt,
|
||||
superhtml,
|
||||
kdePackages,
|
||||
taplo,
|
||||
tinymist,
|
||||
typescript-language-server,
|
||||
vscode-langservers-extracted,
|
||||
simple-completion-language-server,
|
||||
helix,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
|
||||
toml = formats.toml {};
|
||||
helix-config = {
|
||||
theme = "catppuccin_mocha";
|
||||
editor = {
|
||||
cursorline = false;
|
||||
color-modes = true;
|
||||
true-color = true;
|
||||
indent-guides.render = true;
|
||||
lsp = {
|
||||
enable = true;
|
||||
auto-signature-help = true;
|
||||
display-inlay-hints = false;
|
||||
display-messages = true;
|
||||
snippets = true;
|
||||
};
|
||||
file-picker = {
|
||||
hidden = true;
|
||||
};
|
||||
line-number = "relative";
|
||||
auto-format = true;
|
||||
completion-timeout = 5;
|
||||
mouse = true;
|
||||
bufferline = "multiple";
|
||||
soft-wrap.enable = true;
|
||||
cursor-shape = {
|
||||
insert = "bar";
|
||||
normal = "block";
|
||||
select = "underline";
|
||||
};
|
||||
statusline = {
|
||||
left = ["spinner" "version-control" "diagnostics" "file-name"];
|
||||
right = ["file-base-name" "file-type" "position" "file-encoding"];
|
||||
};
|
||||
gutters.layout = ["diff" "diagnostics" "line-numbers" "spacer"];
|
||||
inline-diagnostics = {
|
||||
cursor-line = "hint";
|
||||
other-lines = "error";
|
||||
};
|
||||
};
|
||||
keys = {
|
||||
normal = {
|
||||
space = {
|
||||
g = [":new" ":insert-output XDG_CONFIG_HOME=~/.config ${getExe lazygit}" ":buffer-close!" ":redraw"];
|
||||
i = ":toggle lsp.display-inlay-hints";
|
||||
};
|
||||
esc = ["collapse_selection" "keep_primary_selection" "normal_mode"];
|
||||
A-H = "goto_previous_buffer";
|
||||
A-L = "goto_next_buffer";
|
||||
A-w = ":buffer-close";
|
||||
A-f = ":format";
|
||||
A-r = ":reload";
|
||||
A-x = "extend_to_line_bounds";
|
||||
X = ["extend_line_up" "extend_to_line_bounds"];
|
||||
";" = "flip_selections";
|
||||
"A-;" = "collapse_selection";
|
||||
|
||||
# Kakoune-like config
|
||||
H = "extend_char_left";
|
||||
J = "extend_line_down";
|
||||
K = "extend_line_up";
|
||||
L = "extend_char_right";
|
||||
};
|
||||
select = {
|
||||
A-x = "extend_to_line_bounds";
|
||||
X = ["extend_line_up" "extend_to_line_bounds"];
|
||||
g = {e = "goto_file_end";};
|
||||
};
|
||||
};
|
||||
};
|
||||
helix-languages = callPackage ./languages.nix {inherit lib;};
|
||||
wrapped-helix = symlinkJoin {
|
||||
name = "helix-wrapped";
|
||||
paths = [
|
||||
helix
|
||||
|
||||
# Bash
|
||||
bash-language-server
|
||||
# C/C++
|
||||
clang-tools
|
||||
clippy
|
||||
golangci-lint-langserver
|
||||
gopls
|
||||
lldb_19
|
||||
# Markdown
|
||||
marksman
|
||||
# Nix
|
||||
nil
|
||||
nixd
|
||||
rust-analyzer
|
||||
rustfmt
|
||||
# Shell
|
||||
shellcheck
|
||||
superhtml
|
||||
# toml
|
||||
taplo
|
||||
# typst
|
||||
tinymist
|
||||
# typst lsp
|
||||
vscode-langservers-extracted
|
||||
];
|
||||
nativeBuildInputs = [makeWrapper];
|
||||
postBuild = ''
|
||||
mkdir -p $out/config/helix
|
||||
cp "${toml.generate "config.toml" helix-config}" $out/config/helix/config.toml
|
||||
cp "${helix-languages}" $out/config/helix/languages.toml
|
||||
wrapProgram $out/bin/hx --set \
|
||||
XDG_CONFIG_HOME $out/config
|
||||
'';
|
||||
};
|
||||
in
|
||||
wrapped-helix
|
|
@ -1,111 +1,28 @@
|
|||
{
|
||||
symlinkJoin,
|
||||
makeWrapper,
|
||||
alejandra,
|
||||
basedpyright,
|
||||
bash-language-server,
|
||||
clang-tools,
|
||||
clippy,
|
||||
cmake-format,
|
||||
cmake-language-server,
|
||||
deno,
|
||||
dprint,
|
||||
formats,
|
||||
gdb,
|
||||
golangci-lint-langserver,
|
||||
gopls,
|
||||
lazygit,
|
||||
lib,
|
||||
lldb_19,
|
||||
marksman,
|
||||
nil,
|
||||
nixd,
|
||||
ruff,
|
||||
rust-analyzer,
|
||||
rustfmt,
|
||||
shellcheck,
|
||||
shfmt,
|
||||
superhtml,
|
||||
kdePackages,
|
||||
taplo,
|
||||
tinymist,
|
||||
typescript-language-server,
|
||||
vscode-langservers-extracted,
|
||||
simple-completion-language-server,
|
||||
helix,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.meta) getExe;
|
||||
|
||||
toml = formats.toml {};
|
||||
helix-config = {
|
||||
theme = "catppuccin_mocha";
|
||||
editor = {
|
||||
cursorline = false;
|
||||
color-modes = true;
|
||||
true-color = true;
|
||||
indent-guides.render = true;
|
||||
lsp = {
|
||||
enable = true;
|
||||
auto-signature-help = true;
|
||||
display-inlay-hints = false;
|
||||
display-messages = true;
|
||||
snippets = true;
|
||||
};
|
||||
file-picker = {
|
||||
hidden = true;
|
||||
};
|
||||
line-number = "relative";
|
||||
auto-format = true;
|
||||
completion-timeout = 5;
|
||||
mouse = true;
|
||||
bufferline = "multiple";
|
||||
soft-wrap.enable = true;
|
||||
cursor-shape = {
|
||||
insert = "bar";
|
||||
normal = "block";
|
||||
select = "underline";
|
||||
};
|
||||
statusline = {
|
||||
left = ["spinner" "version-control" "diagnostics" "file-name"];
|
||||
right = ["file-base-name" "file-type" "position" "file-encoding"];
|
||||
};
|
||||
gutters.layout = ["diff" "diagnostics" "line-numbers" "spacer"];
|
||||
inline-diagnostics = {
|
||||
cursor-line = "hint";
|
||||
other-lines = "error";
|
||||
};
|
||||
};
|
||||
keys = {
|
||||
normal = {
|
||||
space = {
|
||||
g = [":new" ":insert-output XDG_CONFIG_HOME=~/.config ${getExe lazygit}" ":buffer-close!" ":redraw"];
|
||||
i = ":toggle lsp.display-inlay-hints";
|
||||
};
|
||||
esc = ["collapse_selection" "keep_primary_selection" "normal_mode"];
|
||||
A-H = "goto_previous_buffer";
|
||||
A-L = "goto_next_buffer";
|
||||
A-w = ":buffer-close";
|
||||
A-f = ":format";
|
||||
A-r = ":reload";
|
||||
A-x = "extend_to_line_bounds";
|
||||
X = ["extend_line_up" "extend_to_line_bounds"];
|
||||
";" = "flip_selections";
|
||||
"A-;" = "collapse_selection";
|
||||
|
||||
# Kakoune-like config
|
||||
H = "extend_char_left";
|
||||
J = "extend_line_down";
|
||||
K = "extend_line_up";
|
||||
L = "extend_char_right";
|
||||
};
|
||||
select = {
|
||||
A-x = "extend_to_line_bounds";
|
||||
X = ["extend_line_up" "extend_to_line_bounds"];
|
||||
g = {e = "goto_file_end";};
|
||||
};
|
||||
};
|
||||
};
|
||||
helix-languages = {
|
||||
language = let
|
||||
mark = lang: {
|
||||
|
@ -158,7 +75,7 @@
|
|||
}
|
||||
{
|
||||
name = "nix";
|
||||
language-servers = ["nil" "scls"];
|
||||
language-servers = ["nil" "scls" "deadnix"];
|
||||
}
|
||||
{
|
||||
name = "qml";
|
||||
|
@ -318,44 +235,5 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
wrapped-helix = symlinkJoin {
|
||||
name = "helix-wrapped";
|
||||
paths = [
|
||||
helix
|
||||
|
||||
# Bash
|
||||
bash-language-server
|
||||
# C/C++
|
||||
clang-tools
|
||||
clippy
|
||||
golangci-lint-langserver
|
||||
gopls
|
||||
lldb_19
|
||||
# Markdown
|
||||
marksman
|
||||
# Nix
|
||||
nil
|
||||
nixd
|
||||
rust-analyzer
|
||||
rustfmt
|
||||
# Shell
|
||||
shellcheck
|
||||
superhtml
|
||||
# toml
|
||||
taplo
|
||||
# typst
|
||||
tinymist
|
||||
# typst lsp
|
||||
vscode-langservers-extracted
|
||||
];
|
||||
nativeBuildInputs = [makeWrapper];
|
||||
postBuild = ''
|
||||
mkdir -p $out/config/helix
|
||||
cp "${toml.generate "config.toml" helix-config}" $out/config/helix/config.toml
|
||||
cp "${toml.generate "languages.toml" helix-languages}" $out/config/helix/languages.toml
|
||||
wrapProgram $out/bin/hx --set \
|
||||
XDG_CONFIG_HOME $out/config
|
||||
'';
|
||||
};
|
||||
in
|
||||
wrapped-helix
|
||||
toml.generate "languages.toml" helix-languages
|
Loading…
Add table
Add a link
Reference in a new issue