Skip to content
프로젝트

srid/rust-nix-template

GitHub에서 보기

소개

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

Original

A 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 update to update all flake inputs.
  • Run nix --accept-flake-config run github:juspay/omnix ci to build all outputs.
  • [pre-commit] hooks will automatically be setup in Nix shell. You can also run pre-commit run -a manually to run the hooks (e.g.: to autoformat the project tree using rustfmt, nixpkgs-fmt, etc.).

Discussion

See Also

관련 프로젝트 살펴보기

불러오는 중…