Skip to content
プロジェクト

srid/rust-nix-template

GitHubで見る

概要

Rust project template with Nix (Flakes) and VSCode support

開発ツール

この数値の測り方

計測したスター増加

24時間
0
7日間
0
15日間
0
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

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

関連プロジェクトを探す

読み込み中…