2025-08-30 20:48:38 +00:00
|
|
|
{
|
|
|
|
|
description = "Bevy project with Rust and dependencies via nixpkgs and oxalica/rust-overlay";
|
|
|
|
|
|
|
|
|
|
inputs = {
|
2025-08-30 21:59:42 +00:00
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
|
2025-08-30 20:48:38 +00:00
|
|
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
outputs =
|
|
|
|
|
{
|
|
|
|
|
self,
|
|
|
|
|
nixpkgs,
|
|
|
|
|
rust-overlay,
|
|
|
|
|
flake-utils,
|
|
|
|
|
}:
|
|
|
|
|
flake-utils.lib.eachDefaultSystem (
|
|
|
|
|
system:
|
|
|
|
|
let
|
|
|
|
|
overlays = [ (import rust-overlay) ];
|
|
|
|
|
pkgs = import nixpkgs { inherit system overlays; };
|
2025-08-30 21:59:42 +00:00
|
|
|
rustToolchain = pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
|
|
|
rustToolchain
|
|
|
|
|
mold
|
|
|
|
|
pkg-config
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
xorgBuildInputs = with pkgs; [
|
|
|
|
|
xorg.libX11
|
|
|
|
|
xorg.libXcursor
|
|
|
|
|
xorg.libXi
|
|
|
|
|
];
|
|
|
|
|
waylandBuildInputs = with pkgs; [
|
|
|
|
|
libxkbcommon
|
|
|
|
|
wayland
|
|
|
|
|
];
|
|
|
|
|
buildInputs =
|
|
|
|
|
with pkgs;
|
|
|
|
|
[
|
|
|
|
|
alsa-lib
|
|
|
|
|
systemd
|
|
|
|
|
vulkan-loader
|
|
|
|
|
]
|
|
|
|
|
++ xorgBuildInputs
|
|
|
|
|
++ waylandBuildInputs;
|
2025-08-30 22:17:11 +00:00
|
|
|
mkShell = pkgs.mkShell.override {
|
|
|
|
|
stdenv = pkgs.stdenvAdapters.useMoldLinker pkgs.clangStdenv;
|
|
|
|
|
};
|
2025-08-30 20:48:38 +00:00
|
|
|
in
|
|
|
|
|
{
|
2025-08-30 22:17:11 +00:00
|
|
|
devShells.default = mkShell {
|
2025-08-30 21:59:42 +00:00
|
|
|
inherit buildInputs nativeBuildInputs;
|
|
|
|
|
|
2025-08-30 20:48:38 +00:00
|
|
|
RUST_BACKTRACE = 1;
|
2025-08-30 21:59:42 +00:00
|
|
|
shellHook = ''
|
|
|
|
|
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${pkgs.lib.makeLibraryPath buildInputs}"
|
|
|
|
|
'';
|
2025-08-30 20:48:38 +00:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|