bevy-playground/flake.nix

47 lines
1.3 KiB
Nix
Raw Normal View History

2023-12-19 10:35:34 -06:00
{
2024-02-02 09:41:32 -06:00
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
2023-12-19 10:35:34 -06:00
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 {
2024-02-02 09:41:32 -06:00
# TODO: maybe use nightly?
# https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/rust.section.md#using-rust-nightly-with-nix-shell-using-rust-nightly-with-nix-shell
2023-12-19 11:17:49 -06:00
# 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
});
};
}