The followings are required for the both purposes of using and developing this tool.
- Nix is installed in your system
- Flake is enabled in your Nix
Note that no extra tool/toolchain is needed in your system even for compiling this tool. Nix provisions everything for and only for this repository.
Execute it for oneshot,
nix run 'git+https://github.com/fujigon/rust-nix-demo-cli#rust-nix-demo-cli'
Open it for oneshot shell,
nix shell 'git+https://github.com/fujigon/rust-nix-demo-cli#rust-nix-demo-cli'
rust-nix-demo-cli
exit
Permanently,
nix profile install 'git+https://github.com/fujigon/rust-nix-demo-cli#rust-nix-demo-cli'
rust-nix-demo-cli
bash -c rust-nix-demo-cli
First, clone this repository.
In a development shell by nix,
nix develop . # opens a new shell that is provisioned by nix to have rust toolchains, see flake.nix
cargo build
cargo run --bin rust-nix-demo-cli
Build it on top of nix,
nix build '.#rust-nix-demo-cli'