aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/nix
diff options
context:
space:
mode:
authorLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-05-29 11:18:16 +0100
committerLibravatar sommerfeld <sommerfeld@sommerfeld.dev>2026-05-29 11:18:16 +0100
commitc84bc29a8e9e963c9d8b4adce40653dddcb02f4c (patch)
tree308cc4bfae92c147750ffa9423c4c4699fbbd458 /nix
parent0d667e494213ef2315261657ab004bcd89a4888c (diff)
downloaddotfiles-c84bc29a8e9e963c9d8b4adce40653dddcb02f4c.tar.gz
dotfiles-c84bc29a8e9e963c9d8b4adce40653dddcb02f4c.tar.bz2
dotfiles-c84bc29a8e9e963c9d8b4adce40653dddcb02f4c.zip
feat(nix/common): expose run-clang-tidy missing from nixpkgs clang-tools
nixpkgs' clang-tools derivation symlinks scripts from clang-unwrapped only when they're executable; run-clang-tidy loses the +x bit during the multi-output split and gets skipped. Re-expose it ourselves by probing clang-unwrapped's main and python outputs (bin/ first, then the legacy share/clang/ layout) and installing the first hit at $out/bin/run-clang-tidy.
Diffstat (limited to 'nix')
-rw-r--r--nix/common.nix22
1 files changed, 21 insertions, 1 deletions
diff --git a/nix/common.nix b/nix/common.nix
index ba3a5e3..5707d2b 100644
--- a/nix/common.nix
+++ b/nix/common.nix
@@ -115,8 +115,28 @@
gnupg
(pass.withExtensions (exts: [ exts.pass-otp ]))
- # C/C++ source tooling (no compiler driver in PATH)
+ # C/C++ source tooling (no compiler driver in PATH).
+ # clang-tools ships clangd/clang-format/clang-tidy and most of the
+ # python helpers (git-clang-format, clang-format-diff, clang-tidy-diff)
+ # but skips run-clang-tidy because the symlink loop in nixpkgs'
+ # clang-tools derivation gates on the +x bit and run-clang-tidy
+ # loses it during the multi-output split. Re-expose it ourselves
+ # from clang-unwrapped's `python` output (tries both the modern
+ # bin/ layout and the legacy share/clang/ layout).
clang-tools
+ (runCommand "run-clang-tidy" { } ''
+ mkdir -p $out/bin
+ for cand in ${llvmPackages.clang-unwrapped}/bin/run-clang-tidy \
+ ${llvmPackages.clang-unwrapped.python}/bin/run-clang-tidy \
+ ${llvmPackages.clang-unwrapped.python}/share/clang/run-clang-tidy.py; do
+ if [ -f "$cand" ]; then
+ install -m755 "$cand" $out/bin/run-clang-tidy
+ exit 0
+ fi
+ done
+ echo "run-clang-tidy not found in clang-unwrapped outputs" >&2
+ exit 1
+ '')
# CI runner (drives podman from pacman; act itself is just a Go binary)
act