bevy-playground/flake.nix

45 lines
1.1 KiB
Nix
Raw Normal View History

2023-12-19 10:35:34 -06:00
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs?rev=2c7f3c0fb7c08a0814627611d9d7d45ab6d75335";
outputs = {
self,
nixpkgs,
}: let
2023-12-19 11:17:49 -06:00
inherit (self) outputs;
2023-12-19 10:35:34 -06:00
supportedSystems = ["x86_64-linux"];
2023-12-19 11:17:49 -06:00
forEachSupportedSystem = nixpkgs.lib.genAttrs supportedSystems;
2023-12-19 10:35:34 -06:00
in {
2023-12-19 11:17:49 -06:00
devShells = forEachSupportedSystem (system: let
pkgs = import nixpkgs {inherit system;};
in {
# TODO: packages
# TODO: checks
rust-dev = pkgs.mkShell rec {
nativeBuildInputs = with pkgs; [pkg-config];
2023-12-19 10:35:34 -06:00
buildInputs = with pkgs; [
2023-12-19 11:17:49 -06:00
clang
2023-12-19 10:35:34 -06:00
cargo
rustc
rustfmt
rustPackages.clippy
rust-analyzer
2023-12-19 11:17:49 -06:00
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
2023-12-19 10:35:34 -06:00
];
2023-12-19 11:17:49 -06:00
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
2023-12-19 10:35:34 -06:00
};
2023-12-19 11:17:49 -06:00
default = outputs.devShells.${system}.rust-dev;
2023-12-19 10:35:34 -06:00
});
};
}