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
This commit is contained in:
@@ -6,13 +6,13 @@
|
||||
}: {
|
||||
options.zed-editor = {
|
||||
enable = lib.mkEnableOption "Zed Editor";
|
||||
remote-server = lib.mkEnableOption "Zed Editor Remote Server";
|
||||
remote-server.enable = lib.mkEnableOption "Zed Editor Remote Server";
|
||||
};
|
||||
|
||||
config.programs.zed-editor = lib.mkIf config.zed-editor.enable {
|
||||
enable = true;
|
||||
package = pkgs.zed-editor;
|
||||
installRemoteServer = lib.mkIf config.zed-editor.remote-server true;
|
||||
installRemoteServer = lib.mkIf config.zed-editor.remote-server.enable true;
|
||||
};
|
||||
|
||||
imports = [
|
||||
|
||||
@@ -62,5 +62,9 @@ _: {
|
||||
};
|
||||
tab_size = 2;
|
||||
};
|
||||
"C++" = {
|
||||
format_on_save = "on";
|
||||
tab_size = 2;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -27,6 +27,27 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
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"
|
||||
|
||||
Reference in New Issue
Block a user