7
3
Fork
You've already forked workflows
1
A collection of useful workflows for getting a new Rust project up and running.
Nix 98.5%
Shell 1.5%
Flori 776ec5e990 Merge pull request 'feat: The Great Ennixification' ( #2 ) from nix into main
Reviewed-on: #2
Reviewed-by: Flori <flori@noreply.codeberg.org>
2025年09月02日 14:42:09 +02:00
modules module[devshell]: move configuration options into perSystem 2025年09月02日 15:29:34 +10:00
packages docs: convert to callPackage-style derivation 2025年09月01日 11:11:14 +10:00
template module[rust]: hash doesn't need to be keyed by system 2025年08月30日 22:45:26 +10:00
.envrc flake: dogfood, with all modules except rustToolchain enabled 2025年08月30日 19:27:28 +10:00
.gitignore flake: dogfood, with all modules except rustToolchain enabled 2025年08月30日 19:27:28 +10:00
docs.md module[devshell]: move configuration options into perSystem 2025年09月02日 15:29:34 +10:00
flake-module.nix module[rust]: rename 2025年08月30日 21:44:31 +10:00
flake.lock nix: convert flake to use flake-parts 2025年08月30日 01:05:20 +10:00
flake.nix docs: convert to callPackage-style derivation 2025年09月01日 11:11:14 +10:00
LICENSE Initial commit 2025年04月09日 20:17:08 +02:00
README.md readme: correct toolchain docs 2025年09月01日 11:19:02 +10:00

workflows

A collection of useful workflows for getting a new Rust project up and running.

Usage

You'll need a Nix implementation installed on your system to work with this repo. If you don't have one already, we recommend setting up Lix.

Once installed, you can create a new project from this repo by running:

mkdir new-project
cd new-project
nix flake init -t git+https://codeberg.org/polyphony/workflows

From there, you can enter a development shell with all the tools needed to work in your project by running nix develop. If you have direnv setup on your machine, you can also run direnv allow to activate the included .envrc file, which will automatically activate the devshell while you're in the project folder.

The development shell will contain a Rust toolchain defined by the rust-toolchain.toml file polyphony.rust.toolchainFile points to in your flake. If you need specific components or targets added to the shell, add them to rust-toolchain.toml and re-enter the development shell.

treefmt, a tool for running multiple formatters over an entire repo, is configured as the flake's formatter. You can run it with either nix fmt, or by calling treefmt directly while in the development shell. By default, it's configured for the following languages:

The development shell will also setup some pre-commit hooks, using git-hooks.nix. You can also run the configured checks manually at any time with nix flake check. By default, the following checks are configured:

Both treefmt and git-hooks can be configured on a per-repo basis, using the standard flake-parts options:

The module also includes some of it's own options for configuring it's behaviour. See the generated docs for a list of options.

Dependencies

scripts/check-license-header.sh requires npx.