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 app
nix run
Drop into a development shell
nix develop
Run app
cargo run
(Optional) Format flake.nix
using Alejandra
nix fmt
-
In
flake.nix
- Edit description
{ description = "project_name"; }
- Change the name of the binary
{ program = "${self.packages.${system}.default}/bin/project_name"; }
- Edit description
-
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
- Add necessary code into the