From a287f2d2e8325b5f6605a09840938c12a268db65 Mon Sep 17 00:00:00 2001 From: Bad Date: Sun, 28 Aug 2022 01:03:01 +0200 Subject: [PATCH] Clangd --- users/modules/neovim/clangd.nix | 18 ++++++++++++++++++ users/modules/neovim/default.nix | 1 + users/profiles/neovim/default.nix | 2 +- 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 users/modules/neovim/clangd.nix 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; }; }