Rust's nightly toolchain is currently required because uefi-rs uses some unstable features.
The easiest way to set this up is using a rustup toolchain file. In
the root of your repository, add
[toolchain] channel = "nightly" targets = ["x86_64-unknown-uefi"]
Here we have specified the
x86_64-unknown-uefi target; there are also
aarch64-unknown-uefi targets available.
Note that nightly releases can sometimes break, so you might opt to pin
to a specific release. For example,
channel = "nightly-2022-11-10".
Run this command to build the application:
cargo build --target x86_64-unknown-uefi
This will produce an x86-64 executable: