move all home level programs to progems dir

This commit is contained in:
ulic-youthlic 2025-02-01 18:43:49 +08:00
parent 77d70dcf2e
commit bc450a9fe7
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
27 changed files with 27 additions and 21 deletions

View file

@ -0,0 +1,85 @@
# theme = "ayu_evolve" # avoid conflicting with stylix
[editor]
line-number = "relative"
cursorline = true
cursorcolumn = false
true-color = true
undercurl = true
bufferline = "multiple"
color-modes = true
default-line-ending = "lf"
popup-border = "all"
[editor.statusline]
left = [
"mode",
"spacer",
"version-control",
"file-type",
"separator",
"read-only-indicator",
"file-name",
"file-modification-indicator",
"spacer",
"spinner",
]
center = ["diagnostics"]
right = [
"register",
"file-line-ending",
"file-encoding",
"separator",
"total-line-numbers",
"position",
"position-percentage",
]
separator = "|"
mode.normal = "NORMAL"
mode.insert = "INSERT"
mode.select = "SELECT"
[editor.lsp]
display-messages = true
display-inlay-hints = true
[editor.cursor-shape]
insert = "bar"
normal = "block"
select = "underline"
[editor.file-picker]
hidden = false
[editor.auto-save]
focus-lost = true
after-delay.enable = true
[editor.whitespace.render]
space = "none"
tab = "all"
nbsp = "all"
newline = "none"
[editor.whitespace.characters]
space = "·"
nbsp = "⍽"
tab = "→"
newline = "⏎"
tabpad = "·"
[editor.indent-guides]
render = true
[editor.gutters]
layout = ["diagnostics", "spacer", "line-numbers", "spacer", "diff"]
line-numbers.min-width = 1
[editor.soft-wrap]
enable = true
wrap-at-text-width = true
[editor.inline-diagnostics]
cursor-line = "hint"
other-lines = "error"
prefix-len = 2

View file

@ -0,0 +1,256 @@
{
lib,
pkgs,
config,
...
}:
{
options = {
youthlic.programs.helix = {
enable = lib.mkEnableOption "helix";
extraPackages = lib.mkOption {
type = lib.types.listOf lib.types.package;
default = [ ];
example = (
with pkgs;
[
deno
]
);
description = ''
extra packages for helix lsp and formatter
'';
};
};
};
config =
let
cfg = config.youthlic.programs.helix;
in
{
programs.helix = lib.mkIf cfg.enable {
enable = true;
defaultEditor = true;
extraPackages = cfg.extraPackages;
settings =
let
config-file = builtins.readFile ./config.toml;
config = builtins.fromTOML config-file;
in
config;
languages = {
language-server = {
neocmakelsp = {
command = "neocmakelsp";
args = [
"stdio"
];
};
fish-lsp = {
command = "fish-lsp";
args = [
"start"
];
};
};
language = [
{
name = "cmake";
language-servers = [
"neocmakelsp"
"cmake-language-server"
];
}
{
name = "kdl";
formatter = {
command = "kdlfmt";
args = [
"format"
"-"
];
};
}
{
name = "just";
formatter = {
command = "just";
args = [
"--dump"
];
};
}
{
name = "nix";
formatter = {
command = "nixfmt";
args = [ "-" ];
};
}
{
name = "xml";
formatter = {
command = "xmllint";
args = [
"--format"
"-"
];
};
}
{
name = "typst";
formatter = {
command = "typstyle";
};
}
{
name = "c";
formatter = {
command = "clang-format";
};
}
{
name = "cpp";
formatter = {
command = "clang-format";
};
}
{
name = "python";
formatter = {
command = "ruff";
args = [
"format"
"-s"
"--line-length"
"88"
"-"
];
};
language-servers = [
"pyright"
"ruff"
];
}
{
name = "go";
formatter = {
command = "goimports";
};
}
{
name = "awk";
formatter = {
command = "awk";
timeout = 5;
args = [
"--file=/dev/stdin"
"--pretty-print=/dev/stdout"
];
};
}
{
name = "fish";
language-servers = [
"fish-lsp"
];
}
{
name = "yaml";
formatter = {
command = "deno";
args = [
"fmt"
"-"
"--ext"
"yaml"
];
};
}
{
name = "html";
formatter = {
command = "deno";
args = [
"fmt"
"-"
"--ext"
"html"
];
};
language-servers = [
"vscode-html-language-server"
];
}
{
name = "css";
formatter = {
command = "deno";
args = [
"fmt"
"-"
"--ext"
"css"
];
};
language-servers = [
"vscode-css-language-server"
];
}
{
name = "toml";
formatter = {
command = "taplo";
args = [
"fmt"
"-"
];
};
}
{
name = "markdown";
formatter = {
command = "deno";
args = [
"fmt"
"-"
"--ext"
"md"
];
};
}
{
name = "json";
language-servers = [
"vscode-json-language-server"
];
formatter = {
command = "deno";
args = [
"fmt"
"-"
"--ext"
"json"
];
};
}
{
name = "jsonc";
language-servers = [
"vscode-json-language-server"
];
formatter = {
command = "deno";
args = [
"fmt"
"-"
"--ext"
"jsonc"
];
};
}
];
};
};
};
}