srid/rust-nix-template
소개
Rust project template with Nix (Flakes) and VSCode support
개발 도구측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalA template Rust project with fully functional and no-frills Nix support, as well as builtin VSCode configuration to get IDE experience without any manual setup (just install direnv, open in VSCode and accept the suggestions). It uses crane, via rust-flake.
[!NOTE] If you are looking for the original template based on this blog post's use of
crate2nix, browse from this tag. The evolution of this template can be gleaned from releases.
Usage
You can use omnix[^omnix] to initialize this template:
nix run nixpkgs#omnix -- init github:srid/rust-nix-template -o ~/my-rust-project
[^omnix]: If initializing manually, make sure to:
- Change name in Cargo.toml.
- Run cargo generate-lockfile in the nix shelld
Adapting this template
- There are two CI workflows, and one of them uses Nix which is slower (unless you configure a cache) than the other one based on rustup. Pick one or the other depending on your trade-offs.
Development (Flakes)
This repo uses Flakes from the get-go.
# Dev shell
nix develop
# or run via cargo
nix develop -c cargo run
# build
nix build
We also provide a justfile for Makefile'esque commands to be run inside of the devShell.
Tips
- Run
nix flake updateto update all flake inputs. - Run
nix --accept-flake-config run github:juspay/omnix cito build all outputs. - [pre-commit] hooks will automatically be setup in Nix shell. You can also run
pre-commit run -amanually to run the hooks (e.g.: to autoformat the project tree usingrustfmt,nixpkgs-fmt, etc.).
Discussion
See Also
관련 프로젝트 살펴보기
불러오는 중…