I got it working. I needed to move everything into buildInputs
instead of having some things in nativeBuildInputs
. I’m still not sure why VS Code worked without this change though.
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
outputs =
{
self,
nixpkgs,
}:
let
pkgs = import nixpkgs {
system = "x86_64-linux";
config = {
allowUnfree = true;
};
};
in
with pkgs;
{
devShells.x86_64-linux.default = mkShell {
buildInputs = [
cargo
rustc
SDL2
alsa-lib.dev
code-cursor
pkg-config
];
shellHook = ''
export PKG_CONFIG_PATH=${pkgs.alsa-lib.dev}/lib/pkgconfig:$PKG_CONFIG_PATH
'';
};
};
}