bevy-playground/flake.nix
2023-12-19 11:17:49 -06:00

45 lines
1.1 KiB
Nix

{
inputs.nixpkgs.url = "github:NixOS/nixpkgs?rev=2c7f3c0fb7c08a0814627611d9d7d45ab6d75335";
outputs = {
self,
nixpkgs,
}: let
inherit (self) outputs;
supportedSystems = ["x86_64-linux"];
forEachSupportedSystem = nixpkgs.lib.genAttrs supportedSystems;
in {
devShells = forEachSupportedSystem (system: let
pkgs = import nixpkgs {inherit system;};
in {
# TODO: packages
# TODO: checks
rust-dev = pkgs.mkShell rec {
nativeBuildInputs = with pkgs; [pkg-config];
buildInputs = with pkgs; [
clang
cargo
rustc
rustfmt
rustPackages.clippy
rust-analyzer
mold
# source: https://github.com/bevyengine/bevy/blob/main/docs/linux_dependencies.md#nix
udev
alsa-lib
vulkan-loader
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
libxkbcommon
wayland
];
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
};
default = outputs.devShells.${system}.rust-dev;
});
};
}