Skip to content

refactor(nix): replace manual bindgen env with rustPlatform.bindgenHook#1255

Open
xilec wants to merge 1 commit intocjpais:mainfrom
xilec:refactor/use-bindgen-hook
Open

refactor(nix): replace manual bindgen env with rustPlatform.bindgenHook#1255
xilec wants to merge 1 commit intocjpais:mainfrom
xilec:refactor/use-bindgen-hook

Conversation

@xilec
Copy link
Copy Markdown
Contributor

@xilec xilec commented Apr 8, 2026

Summary

  • Replaced hand-crafted LIBCLANG_PATH and BINDGEN_EXTRA_CLANG_ARGS with rustPlatform.bindgenHook
  • Removed llvmPackages.libclang from both package and devShell inputs

bindgenHook is a standard nixpkgs setup hook that reads include paths (including libc.dev) from the cc-wrapper automatically. It's simpler, less error-prone, and consistent with how other Rust+bindgen packages in nixpkgs handle it (e.g. atuin-desktop).

Context: while reviewing the nixpkgs upstream PR (NixOS/nixpkgs#507754), I discovered that manually setting BINDGEN_EXTRA_CLANG_ARGS with ${stdenv.cc.libc}/include instead of ${stdenv.cc.libc.dev}/include silently breaks Vulkan bindgen — bindgenHook avoids this class of bugs entirely.

Test plan

  • nix build .#handy succeeds
  • Application launches, hotkeys and transcription work correctly
  • Vulkan GPU acceleration works (Whisper Turbo model tested)

Replace hand-crafted LIBCLANG_PATH and BINDGEN_EXTRA_CLANG_ARGS with
rustPlatform.bindgenHook, which reads the correct include paths
(including libc.dev) from the cc-wrapper automatically.
@xilec xilec force-pushed the refactor/use-bindgen-hook branch from 2f88dd3 to e03200a Compare April 8, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant