I’m trying to package a Rust application that has a few external dependencies. However, when I try and plug these dependencies into the buildInputs or nativeBuildInputs of buildRustPackage, they are not detected with the error that libusb-1.0 can not be found. However, in a nix shell with the same dependencies, it compiles just fine.
Thoughts?
package (fails with aforementioned error):
default = pkgs.callPackage pkgs.rustPlatform.buildRustPackage rec {
pname = "Rstreamdeck";
version = "0.0.1-alpha";
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
buildAndTestSubdir = "streamdeck-control";
buildInputs = with pkgs; [
hidapi
pkgconf
libusb1
dbus
];
};
Nix shell (it compiles correctly when cargo build is used here):
devShells.${system} = {
default = pkgs.mkShell {
packages = with pkgs; [
hidapi
pkgconf
libusb1
# rust-bin.stable.latest.default
rust-analyzer
lldb
dbus
cargo
rustc
];
};
}