hi @bernborgess – you are close, but missing a few dependencies and inputs that could get a dev shell working with bevy. Fortunately, the bevy community does have a recommended/minimal flake.nix to get you started – bevy/docs/linux_dependencies.md at 5f8270f2e049f90139a503d1e930070d926f9427 · bevyengine/bevy · GitHub
{
description = "bevy flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
nixpkgs,
rust-overlay,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
in
{
devShells.default =
with pkgs;
mkShell {
buildInputs =
[
# Rust dependencies
(rust-bin.stable.latest.default.override { extensions = [ "rust-src" ]; })
pkg-config
]
++ lib.optionals (lib.strings.hasInfix "linux" system) [
# for Linux
# Audio (Linux only)
alsa-lib
# Cross Platform 3D Graphics API
vulkan-loader
# For debugging around vulkan
vulkan-tools
# Other dependencies
libudev-zero
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
libxkbcommon
];
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
LD_LIBRARY_PATH = lib.makeLibraryPath [
vulkan-loader
xorg.libX11
xorg.libXi
xorg.libXcursor
libxkbcommon
];
};
}
);
}
I did the following:
git clone git@github.com:bevyengine/bevy.git
cd bevy
# create flake.nix with above contents
vim flake.nix
git add flake.nix
nix develop
cargo run --example bloom_2d
