diff options
| author | Kyren223 <Kyren223@proton.me> | 2024-11-30 13:20:25 +0200 |
|---|---|---|
| committer | Kyren223 <Kyren223@proton.me> | 2024-11-30 13:20:25 +0200 |
| commit | ecd2eb15762683b796584e71c28b2384e55a3f65 (patch) | |
| tree | f28881eded9b90895aa594440fbbdec8b5cacad8 | |
| parent | ccc402964b4e75efa1337672b08c631ebefbb485 (diff) | |
Made clangd work and recognize C headers, see https://www.reddit.com/r/NixOS/comments/1d7zvgu/nvim_cant_find_standard_library_headers/
for troubleshooting/reference if it happens again
| -rw-r--r-- | .config/nvim/lua/custom/config/language-servers.lua | 1 | ||||
| -rw-r--r-- | .config/nvim/lua/custom/plugins/nvim-lspconfig.lua | 3 | ||||
| -rw-r--r-- | hosts/laptop-nixos/configuration.nix | 11 |
3 files changed, 12 insertions, 3 deletions
diff --git a/.config/nvim/lua/custom/config/language-servers.lua b/.config/nvim/lua/custom/config/language-servers.lua index 88b9db9..df1fad5 100644 --- a/.config/nvim/lua/custom/config/language-servers.lua +++ b/.config/nvim/lua/custom/config/language-servers.lua @@ -14,6 +14,7 @@ return { }, }, -- lua clangd = { + mason = false, cmd = { 'clangd', '--background-index', diff --git a/.config/nvim/lua/custom/plugins/nvim-lspconfig.lua b/.config/nvim/lua/custom/plugins/nvim-lspconfig.lua index b864c7a..0b358fe 100644 --- a/.config/nvim/lua/custom/plugins/nvim-lspconfig.lua +++ b/.config/nvim/lua/custom/plugins/nvim-lspconfig.lua @@ -14,6 +14,9 @@ return { local ensure_installed = vim.tbl_filter(function(key) local server = language_servers[key] if type(server) == 'table' then + if server.mason ~= nil then + return server.mason + end return true else return server diff --git a/hosts/laptop-nixos/configuration.nix b/hosts/laptop-nixos/configuration.nix index d49e923..5e73c74 100644 --- a/hosts/laptop-nixos/configuration.nix +++ b/hosts/laptop-nixos/configuration.nix @@ -65,9 +65,6 @@ # Enable touchpad support (enabled default in most desktopManager). # services.xserver.libinput.enable = true; - # Enable dynamic linking of applications that are not in nixpkgs (for vim LSPs for example). - programs.nix-ld.enable = true; - # Allow sudo without a password if in "wheel" group. security.sudo.wheelNeedsPassword = false; @@ -98,6 +95,14 @@ environment.systemPackages = with pkgs; [ glib-networking openssl + clang + clang-tools + ]; + + # Enable dynamic linking of applications that are not in nixpkgs (for vim LSPs for example). + programs.nix-ld.enable = true; + programs.nix-ld.libraries = with pkgs; [ + stdenv.cc.cc ]; # Some programs need SUID wrappers, can be configured further or are |
