feat: update system

This commit is contained in:
2025-02-01 11:55:20 +01:00
parent 998a7b9166
commit 84004b6391
29 changed files with 430 additions and 203 deletions

View File

@@ -1,10 +1,15 @@
{ lib, config, ... }:
{
lib,
config,
...
}:
let
cfg = config.presets.languages.c;
in
{
options.presets.languages.c = {
enable = lib.mkEnableOption "C/C++";
cppcheck = lib.mkEnableOption "cppcheck";
};
config = lib.mkIf cfg.enable {
@@ -13,12 +18,28 @@ in
c = [ "clang-format" ];
cpp = [ "clang-format" ];
};
lsp.servers.clangd = {
none-ls = {
enable = true;
cmd = [
"clangd"
"--offset-encoding=utf-16"
];
sources.diagnostics = {
cppcheck = lib.mkIf cfg.cppcheck {
enable = true;
};
};
};
lsp.servers = {
clangd = {
enable = true;
cmd = [
"clangd"
"--offset-encoding=utf-16"
];
settings.InlayHints = {
Designators = true;
Enabled = true;
ParameterNames = true;
DeducedTypes = true;
};
};
};
};
};

View File

@@ -42,7 +42,31 @@ in
}
];
lsp.servers = {
ts_ls.enable = true;
ts_ls = {
enable = true;
settings = {
typescript.inlayHints = {
includeInlayParameterNameHints = "all";
includeInlayParameterNameHintsWhenArgumentMatchesName = true;
includeInlayFunctionParameterTypeHints = true;
includeInlayVariableTypeHints = true;
includeInlayVariableTypeHintsWhenTypeMatchesName = true;
includeInlayPropertyDeclarationTypeHints = true;
includeInlayFunctionLikeReturnTypeHints = true;
includeInlayEnumMemberValueHints = true;
};
javascript.inlayHints = {
includeInlayParameterNameHints = "all";
includeInlayParameterNameHintsWhenArgumentMatchesName = true;
includeInlayFunctionParameterTypeHints = true;
includeInlayVariableTypeHints = true;
includeInlayVariableTypeHintsWhenTypeMatchesName = true;
includeInlayPropertyDeclarationTypeHints = true;
includeInlayFunctionLikeReturnTypeHints = true;
includeInlayEnumMemberValueHints = true;
};
};
};
eslint.enable = lib.mkIf cfg.eslint true;
};
};

View File

@@ -15,6 +15,10 @@ in
config = lib.mkIf cfg.enable {
plugins = {
conform-nvim.settings.formatters_by_ft.nix = [ "nixfmt" ];
none-ls = {
enable = true;
sources.diagnostics.statix.enable = true;
};
lsp.servers.nil_ls.enable = true;
nix.enable = true;
};

View File

@@ -14,6 +14,28 @@ in
enable = true;
installCargo = false;
installRustc = false;
settings.inlayHints = {
bindingModeHints.enable = false;
chainingHints.enable = true;
closingBraceHints = {
enable = true;
minLines = 25;
};
closureReturnTypeHints.enable = "never";
lifetimeElisionHints = {
enable = "never";
useParameterNames = false;
};
maxLength = 25;
parameterHints.enable = true;
reborrowHints.enable = "never";
renderColons = true;
typeHints = {
enable = true;
hideClosureInitialization = false;
hideNamedConstructor = false;
};
};
};
};
};

View File

@@ -0,0 +1,27 @@
{
lib,
config,
...
}:
let
cfg = config.presets.languages.svelte;
in
{
options.presets.languages.svelte = {
enable = lib.mkEnableOption "Svelte";
};
config = lib.mkIf cfg.enable {
plugins.lsp.servers.svelte = {
enable = true;
settings.typescript.inlayHints = {
parameterNames.enabled = "all";
parameterTypes.enabled = true;
variableTypes.enabled = true;
propertyDeclarationTypes.enabled = true;
functionLikeReturnTypes.enabled = true;
enumMemberValues.enabled = true;
};
};
};
}