Skip to content

Latest commit

 

History

History

bevy

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Nix Flake Template for Bevy (rust) using Fenix and Naersk

All of this information is also included in the README.md

Initialize using

nix flake init --template "github:nulladmin1/nix-flake-templates#bevy

This is how to structure of the template looks like:

📦 bevy
├── ⚙️ .envrc
├── 🙈 .gitignore
├── 🔒Cargo.lock
├── ⚙️ Cargo.toml
├── 📃 README.md
├── ❄️ flake.nix
└── 📁src
    └── 🦀 main.rs

It includes a really simple Hello World program

Inspired from:

Run using crane (Recommended)

Run app

nix run

Run using Cargo

Drop into a development shell

nix develop

Run app

cargo run

(Optional) Format flake.nix using Alejandra

nix fmt

To customize it to your own needs

  • In flake.nix

    • Edit description
      {
          description = "project_name";
      }
    • Change the name of the binary
    {
          program = "${self.packages.${system}.default}/bin/project_name";
    }
  • In Cargo.toml

    • Change name, version, edition, etc.
    	[package]
    	name = "project_name"
    	version = "0.1.0"
    	edition = "2021"
  • For the structure and code

    • Add necessary code into the src/ directory