You can use this template to start a new rust project.
- (install nix and open nix flake development shell)
- the git repo contains a
flake.nixconfiguration - you can open a dev shell via
nix develop
- you can open vscode from inside the nix dev shell via
- option 1:
nix develop --command code . - option 2:
./ctl.sh nix:vscode
- option 1:
- create your own repo by using this template
- rename your package
- in
Cargo.toml
- in
- rename
projectvariable insrc/main.rsfor log level configuration
-
you can run the code via
cargo run
-
this template use a rust crate called clap for cli development
-
use cli arguments after two dashes
--when running the program viacargo# cli help cargo run -- -h # example run cargo run -- --name Julius --count 3
- set the environment variable
RUST_LOGto configure log levels per module
RUST_LOG="warn,rust_project_template::example_module::example_submodule=debug" cargo run- create a file called
.envin the root dir of the repoRUST_LOG="warn,rust_project_template::example_module::example_submodule=debug" - run you app with the following command
./ctl.sh cargo:run