- Notifications
You must be signed in to change notification settings - Fork0
template for rust projects with nix
License
NotificationsYou must be signed in to change notification settings
j-brn/nix-rust-template
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
- workspace support
- build withcrane
- most recent and/or custom rust toolchain withfenix
- cargo clippy, fmt, test, doc and audit as flake checks
- complete Github CI with automatic lockfile updates, flake checks, build
- automatic bundling of releases (deb, rpm, pacman, AppImage, Docker) for aarch64-linux and x86_64-linux
- Nix has to be installed andflakes and the experimental nix command have to be enabled
- (optional) install and setupdirenv to automatically enter the dev shell in this directory
- (optional) obtain apersonal GitHub access tokenwith read and write access on this repository for automatic flake updates. Automatic flake updates also work withouta personal access token, but pipelines won't trigger for the update pull requests if you use the standard GitHub Bot user
- click "use this template" to create your repository
- rename or remove the existing crates
- rename or recreate all crates under
crates/
with names of your choosing - in
Cargo.toml
change the paths in the[members]
field to the crates you just created/renamed - in
.github/workflows/ci.yml
replace/delete "client" and "server" in the job matrix for "bundle" amd "build" - in
flake.nix
- replace/delete "client-package" and "server-package" with "$name-package"
- replace/delete
packages.client
andpackages.server
topackages.$name
- replace/delete the
inherit client-package server-package
in the devShell section with the new names andadd/remove any crates you added/removed
- rename or recreate all crates under
- create the repository secret
GH_TOKEN_FOR_UPDATES
with your personal GitHub access token or replace${{ secrets.GH_TOKEN_FOR_UPDATES }}
with${{ secrets.GITHUB_TOKEN }}
in.github/workflows/update.yml
- (optional) enable theRenovate bot for automatic rust and actions dependency updatesor delete
renovate.json
- (optional) allow direnv to run:
direnv allow
nix build
to buildnix flake check
to run testsnix develop
to enter the dev shell (happens automatically when using direnv)
- darwin support
- cross compilation for windows
- code coverage checks
- actions/scripts to automate most of [Getting Started]
About
template for rust projects with nix