#Help with nix for Google IDX

4 messages · Page 1 of 1 (latest)

fervent parcel
#

Hi everyone! Recently, I've been pretty interested in trying out the Google IDX editor. However, the template dev.nix file for rust doesn't work perfectly with bevy (or at least my code).

Notably, I'm having issues with the dependencies for: wayland, and alsa.
Essentially, the rust builder is panicking when building those dependencies because it is unwrapping a None type as the needed files (e.g. alsa.pc) are not found.

I tried following the nix guide: https://github.com/bevyengine/bevy/blob/main/docs/linux_dependencies.md
but Google IDX seems to have a different system when it comes to Nix setup such that I can't build the shell directly and can only add packages/environment variables?

I tried adding them as packages like so:
packages = [
pkg.pkg-config
pkg.udev
#etc.
];

But that didn't work at all!

I also tried adding them as an environment variable, with lib.makeLibraryPath but that also didn't work!

So I genuinely have no idea what to do to allow my code to compile. (No, I do not have any experience with Nix)

Thanks in advance! 👍

GitHub

A refreshingly simple data-driven game engine built in Rust - bevyengine/bevy

inner tartan
#

not sure this will help but i just use this flake for my native nixos machine

{
  description = "Bevy flake";

  inputs.flake-utils.url = "github:numtide/flake-utils";

  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system:
      let pkgs = nixpkgs.legacyPackages.${system};
      in {
        devShell = with pkgs; mkShell
          rec {
            nativeBuildInputs = [
              pkg-config
              rustup
            ];

            buildInputs = [
              zstd
              alsa-lib
              libxkbcommon
              udev
              vulkan-loader
              wayland
              xorg.libX11
              xorg.libXcursor
              xorg.libXi
              xorg.libXrandr
            ];

            LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs;

            # only uncomment this if you are running into "amdvlk64.so not found" with lldb
            # VK_ICD_FILENAMES = "/run/opengl-driver/share/vulkan/icd.d/radeon_icd.x86_64.json:/run/opengl-driver-32/share/vulkan/icd.d/radeon_icd.i686.json";
          };
      });
}
fervent parcel
#

Thanks for the sample code!

#

Managed to solve it with a bit of AI help; turns out I just needed to use the .dev versions of the issue packages :/