From 42ef7fa0a583dee2f2a924f1b10f5bf2160a4b33 Mon Sep 17 00:00:00 2001 From: derped Date: Sat, 21 Dec 2024 21:54:06 +0100 Subject: [PATCH] nvim: add ccls (C) lsp --- pkgsets/cpp.nix | 4 +--- pkgsets/nvim/lsp/c.nix | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 pkgsets/nvim/lsp/c.nix diff --git a/pkgsets/cpp.nix b/pkgsets/cpp.nix index e1c5ec3..32d7b10 100644 --- a/pkgsets/cpp.nix +++ b/pkgsets/cpp.nix @@ -1,14 +1,12 @@ { - config, pkgs, ... }: { config.machine.pkgsets.cpp.pkgs = with pkgs; [ + bear clang cmake gcc - global - irony-server ]; } diff --git a/pkgsets/nvim/lsp/c.nix b/pkgsets/nvim/lsp/c.nix new file mode 100644 index 0000000..d7d64dc --- /dev/null +++ b/pkgsets/nvim/lsp/c.nix @@ -0,0 +1,22 @@ +{ + lib, + config, + pkgs, + ... +}: + +lib.optionalString (lib.elem "nvim::lsp::c" config.machine.pkgs) # lua + '' + lspconfig.ccls.setup { + cmd = { "${pkgs.ccls}/bin/ccls" }, + init_options = { + compilationDatabaseDirectory = "build"; + index = { + threads = 0; + }; + clang = { + excludeArgs = { "-frounding-math"} ; + }; + } + } + ''