Files
garandos/modules/home/zed/user-settings/lsp.nix
GarandPLG 087ffd4194 Refactor Zed/Flatpak options and add C++ & clangd settings
- Switch Zed remote server and Flatpak packages to use `enable`
suboption - Update host modules to match the new option hierarchy - Add
default C++ settings (format on save, tab size) to Zed user settings -
Introduce clangd LSP configuration with inlay hints and fallback command
2025-12-01 13:28:43 +01:00

68 lines
1.7 KiB
Nix

{
pkgs,
lib,
username,
host,
...
}: {
programs.zed-editor.userSettings.lsp = {
rust-analyzer = {
binary = {
path = lib.getExe pkgs.bash;
arguments = [
"-c"
"if [ -e flake.nix ]; then nix develop --command rust-analyzer; else rust-analyzer; fi"
];
};
initialization_options = {
inlayHints = {
maxLength = null;
lifetimeElisionHints = {
enable = "skip_trivial";
useParameterNames = true;
};
closureReturnTypeHints = {
enable = "always";
};
};
};
};
clangd = {
binary = {
path = lib.getExe pkgs.bash;
arguments = [
"-c"
"if [ -e flake.nix ]; then nix develop --command clangd; else clangd; fi"
];
};
initialization_options = {
inlayHints = {
maxLength = null;
lifetimeElisionHints = {
enable = "skip_trivial";
useParameterNames = true;
};
closureReturnTypeHints = {
enable = "always";
};
};
};
};
nixd = {
initialization_options.formatting.command = [
"alejandra"
"--quiet"
"--"
];
settings = {
nixpkgs.expr = "import <nixpkgs> { }";
formatting.command = ["alejandra"];
options = {
nixos.expr = "(builtins.getFlake (builtins.toString \"/home/${username}/garandos\")).nixosConfigurations.\"${host}\".options";
home-manager.expr = "(builtins.getFlake (builtins.toString \"/home/${username}/garandos\")).nixosConfigurations.\"${host}\".options.home-manager.users.type.getSubOptions []";
};
};
};
};
}