nix-community.nixvim/plugins/by-name/cmake-tools/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

163 lines
4.4 KiB
Nix
Raw Normal View History

{ lib, ... }:
let
inherit (lib.nixvim) defaultNullOpts;
in
2024-12-22 09:58:27 +00:00
lib.nixvim.plugins.mkNeovimPlugin {
2024-04-11 23:51:25 +02:00
name = "cmake-tools";
packPathName = "cmake-tools.nvim";
package = "cmake-tools-nvim";
2024-04-11 23:51:25 +02:00
2024-09-27 05:28:00 +01:00
maintainers = [ lib.maintainers.NathanFelber ];
2024-04-11 23:51:25 +02:00
settingsOptions = {
cmake_command = defaultNullOpts.mkStr "cmake" ''
2024-04-11 23:51:25 +02:00
This is used to specify cmake command path.
'';
ctest_command = defaultNullOpts.mkStr "ctest" ''
2024-04-11 23:51:25 +02:00
This is used to specify ctest command path.
'';
cmake_regenerate_on_save = defaultNullOpts.mkBool true ''
2024-04-11 23:51:25 +02:00
Auto generate when save CMakeLists.txt.
'';
cmake_generate_options =
defaultNullOpts.mkAttrsOf lib.types.anything { "-DCMAKE_EXPORT_COMPILE_COMMANDS" = 1; }
2024-04-11 23:51:25 +02:00
''
This will be passed when invoke `CMakeGenerate`.
'';
cmake_build_options = defaultNullOpts.mkAttrsOf lib.types.anything { } ''
2024-04-11 23:51:25 +02:00
This will be passed when invoke `CMakeBuild`.
'';
cmake_build_directory = defaultNullOpts.mkStr "out/\${variant:buildType}" ''
2024-04-11 23:51:25 +02:00
This is used to specify generate directory for cmake, allows macro expansion, relative to vim.loop.cwd().
'';
cmake_soft_link_compile_commands = defaultNullOpts.mkBool true ''
2024-04-11 23:51:25 +02:00
This will automatically make a soft link from compile commands file to project root dir.
'';
cmake_compile_commands_from_lsp = defaultNullOpts.mkBool false ''
2024-04-11 23:51:25 +02:00
This will automatically set compile commands file location using lsp, to use it, please set `cmake_soft_link_compile_commands` to false.
'';
cmake_kits_path = defaultNullOpts.mkStr null ''
2024-04-11 23:51:25 +02:00
This is used to specify global cmake kits path, see CMakeKits for detailed usage.
'';
cmake_variants_message = {
short = defaultNullOpts.mkAttrsOf lib.types.anything { show = true; } ''
2024-04-11 23:51:25 +02:00
Whether to show short message.
'';
long =
defaultNullOpts.mkAttrsOf lib.types.anything
2024-04-11 23:51:25 +02:00
{
show = true;
max_length = 40;
}
''
Whether to show long message.
'';
};
cmake_dap_configuration = {
name = defaultNullOpts.mkStr "cpp" ''
2024-04-11 23:51:25 +02:00
Name of the launch configuration.
'';
type = defaultNullOpts.mkStr "codelldb" ''
2024-04-11 23:51:25 +02:00
Debug adapter to use.
'';
request = defaultNullOpts.mkStr "launch" ''
2024-04-11 23:51:25 +02:00
Session initiation method.
'';
};
cmake_executor = {
name = defaultNullOpts.mkStr "quickfix" ''
2024-04-11 23:51:25 +02:00
Name of the executor.
'';
opts = defaultNullOpts.mkAttrsOf lib.types.anything { } ''
2024-04-11 23:51:25 +02:00
The options the executor will get, possible values depend on the executor type.
'';
};
cmake_runner = {
name = defaultNullOpts.mkStr "terminal" ''
2024-04-11 23:51:25 +02:00
Name of the runner.
'';
opts = defaultNullOpts.mkAttrsOf lib.types.anything { } ''
2024-04-11 23:51:25 +02:00
The options the runner will get, possible values depend on the runner type.
'';
};
cmake_notifications = {
runner.enabled = defaultNullOpts.mkBool true "";
2024-04-11 23:51:25 +02:00
executor.enabled = defaultNullOpts.mkBool true "";
2024-04-11 23:51:25 +02:00
spinner =
defaultNullOpts.mkListOf lib.types.str
2024-04-11 23:51:25 +02:00
[
""
""
""
""
""
""
""
""
""
""
]
''
Icons used for progress display.
'';
refresh_rate_ms = defaultNullOpts.mkPositiveInt 100 ''
2024-04-11 23:51:25 +02:00
How often to iterate icons.
'';
};
};
settingsExample = {
cmake_regenerate_on_save = false;
cmake_build_directory = "build/\${variant:buildtype}";
cmake_soft_link_compile_commands = false;
cmake_dap_configuration = {
name = "Launch file";
type = "codelldb";
request = "launch";
program.__raw = ''
function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end
'';
cwd = "\${workspaceFolder}";
stopOnEntry = false;
};
cmake_executor.name = "toggleterm";
cmake_runner.name = "toggleterm";
cmake_notifications = {
spinner = [
""
""
""
""
""
""
""
""
];
refresh_rate_ms = 80;
};
};
}