Skip to content
/ template-nix Public template

🦀 Rust development template for Nix ❄️

License

Notifications You must be signed in to change notification settings

helium18/template-nix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

❄️ template-nix 🦀

NixOS NixOS License

Minimal Rust development template for Nix



Who is this for

  • Someone who wants to apply Nix's power for Rust development.
  • Who's not very comfortable with Flakes (you still need to have a basic understanding)
  • Need something minimal that just works

Reference

  1. wiki/Flakes❗Read the output schema carefully (especially defaultPackage, legacyPackages and devShells)❗
  2. Fenix - used for managing Rust toolchains (read the makeRustPlatform example)
  3. rust-section of language frameworks - optional (use it for extending the template)

So how do I use it ??

This repository has two branches

  1. main: normal verbose branch. For those who prefer explanations
  2. non-verbose: you know your stuff and don't want explanations. You'll get a clean template with no comments

then click on the Use this template button (https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-a-repository-from-a-template)

run nix flake update . to update the flake lock

Commands

  • nix develop: opens up a bash shell with the bare minimum Rust toolset (cargo & rustc) by default
  • nix build : builds the Rust project. Outputs the binary to ./result/bin/<name>
  • nix run: runs the Rust program.

FAQ

... Waiting for questions ... (raise an issue in case of doubts)

Support

Consider starring the repo ⭐🦀

About

🦀 Rust development template for Nix ❄️

Topics

Resources

License

Stars

Watchers

Forks