nixide/rust/nci.nix
Robert Hensing caff9a2019 maint: Fix nix-packaged build
(cherry picked from commit 9535898dc4fbe466addf7fde47a6cafc3d267039)
2025-10-04 02:30:46 +02:00

35 lines
1 KiB
Nix

{
perSystem = { lib, config, pkgs, ... }: {
# https://flake.parts/options/nix-cargo-integration
nci.projects.nix-bindings = {
path = ./.;
drvConfig = {
mkDerivation = {
buildInputs = [
config.packages.nix
# stdbool.h
pkgs.stdenv.cc
];
nativeBuildInputs = [
pkgs.pkg-config
];
};
# NOTE: duplicated in flake.nix devShell
env = {
LIBCLANG_PATH =
if pkgs.stdenv.cc.isClang then
null # don't set the variable
else
lib.makeLibraryPath [ pkgs.buildPackages.llvmPackages.clang-unwrapped ];
BINDGEN_EXTRA_CLANG_ARGS =
if pkgs.stdenv.cc.isClang then
null # don't set the variable
else
"-I${pkgs.stdenv.cc.libc.dev}/include"
+ " -I${lib.getDev pkgs.stdenv.cc.cc}/lib/gcc/${pkgs.stdenv.hostPlatform.config}/${pkgs.stdenv.cc.cc.version}/include"
;
};
};
};
};
}