diff --git a/users/modules/neovim/clangd.nix b/users/modules/neovim/clangd.nix new file mode 100644 index 0000000..c16fc71 --- /dev/null +++ b/users/modules/neovim/clangd.nix @@ -0,0 +1,18 @@ +{ lib, pkgs, config, ... }: +let + cfg = config.mae.nvim.clangd; +in +with lib; +{ + options.mae.nvim.clangd.enable = lib.mkEnableOption "Enable C/C++ language support(with clangd) in neovim"; + config = mkIf cfg.enable { + mae.nvim.lsp.servers.clangd = { + enable = true; + script = '' + { + cmd = { "${pkgs.clang-tools}/bin/clangd" }, + } + ''; + }; + }; +} diff --git a/users/modules/neovim/default.nix b/users/modules/neovim/default.nix index 72b35d1..753b91f 100644 --- a/users/modules/neovim/default.nix +++ b/users/modules/neovim/default.nix @@ -10,6 +10,7 @@ in ./go.nix ./rust.nix ./nix.nix + ./clangd.nix ]; options.mae.nvim = { diff --git a/users/profiles/neovim/default.nix b/users/profiles/neovim/default.nix index a7bdbef..4cf3cb5 100644 --- a/users/profiles/neovim/default.nix +++ b/users/profiles/neovim/default.nix @@ -8,7 +8,7 @@ nix.enable = true; rust.enable = true; go.enable = true; - #clangd.enable = true; + clangd.enable = true; #python.enable = true; }; }