summaryrefslogtreecommitdiffstats
path: root/flake.nix
diff options
context:
space:
mode:
authorSam Estep <sam@samestep.com>2025-07-28 17:11:11 -0400
committerGitHub <noreply@github.com>2025-07-28 21:11:11 +0000
commita2d93ae0122aff62866e9266e5e51d4615a00783 (patch)
tree623dbfc90be3142359d044725a347ee7bb4bb880 /flake.nix
parent5f8475bee2589b8e851c856135cf10758e859e72 (diff)
Disable automatic `#include` insertion for clangd (#7951)
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix21
1 files changed, 17 insertions, 4 deletions
diff --git a/flake.nix b/flake.nix
index 5b63b0e4c..3f1bf6e62 100644
--- a/flake.nix
+++ b/flake.nix
@@ -21,10 +21,23 @@
# the latter brings in GCC by default on Linux.
devShell = pkgs.mkShellNoCC {
buildInputs = [
- # Must put `clang-tools` before `clang` for clangd to work properly.
- # We use `llvmPackages_17.clang-tools` instead of just `clang-tools`
- # to match the `clang-format` version used in CI.
- pkgs.llvmPackages_17.clang-tools
+ # We must list clangd before the `clang` package to make sure it
+ # comes earlier on the `PATH`, and we must get it from the
+ # `clang-tools` package so that it is wrapped properly.
+ (pkgs.linkFarm "clangd-21" [
+ {
+ name = "bin/clangd";
+ # New enough to support `HeaderInsertion: Never` in `.clangd`.
+ path = "${pkgs.llvmPackages_21.clang-tools}/bin/clangd";
+ }
+ ])
+ (pkgs.linkFarm "clang-format-17" [
+ {
+ name = "bin/clang-format";
+ # Match the clang-format version used in CI.
+ path = "${pkgs.llvmPackages_17.clang-tools}/bin/clang-format";
+ }
+ ])
pkgs.clang
pkgs.cmake