Skip to content

A simple and easy-to-edit Nix development flake, for painless Bevy development and cross-compilation on NixOS.

License

Notifications You must be signed in to change notification settings

swagtop/bevy-flake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bevy-flake

A simple and easy-to-edit Nix development flake, for painless Bevy development and cross-compilation on NixOS. This flake is meant to help new NixOS users hit the ground running, and get started quickly, with as little hassle as possible.

Using rust-overlay for the rust toolchain, and cargo-zigbuild, cargo-xwin for cross-compilation.

Quick setup

Fetch flake.nix into your project root directory, and add it to the git index:

cd /path/to/project
wget https://github.com/swagtop/bevy-flake/raw/refs/heads/main/flake.nix
git add flake.nix

Enter the development shell, and then run or compile your Bevy program:

nix develop

# Your NixOS system
cargo build
cargo run

# Other systems
cargo build --target x86_64-unknown-linux-gnu --release
cargo build --target x86_64-pc-windows-msvc --release
cargo build --target aarch64-apple-darwin --release # Read docs/macos.md!
cargo build --target wasm32-unknown-unknown --release

bevy-flake wraps cargo in a shell script, setting the RUSTFLAGS environment variable appropreate for the situation, and using cargo-zigbuild, cargo-xwin to cross compile.

                          ╭────────────────╴ cargo ╶────────────────╮
                          │                                         │
            (localFlags)  │                                         │  (crossFlags)
                          │     ╔═══════════target/═══════════╗     │
                          ├──────► debug/                     ║     │
                          ╰──────► release/                   ║     │
                                ║  x86_64-unknown-linux-gnu/ ◄──────┤
                                ║  x86_64-pc-windows-msvc/ ◄────────┤
                                ║  aarch64-apple-darwin/ ◄──────────╯
                                ╚═════════════════════════════╝

About

A simple and easy-to-edit Nix development flake, for painless Bevy development and cross-compilation on NixOS.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages