No description
  • Nix 99%
  • Rust 1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ezozbek 6702ff1d03
Some checks failed
Test CI / lints (push) Successful in 14s
Test CI / test-project (push) Failing after 9s
Test CI / build-project (push) Has been skipped
change order
2026-10-26 15:27:32 +05:00
.forgejo/workflows change order 2026-10-26 15:27:32 +05:00
src testing wrong formatting 2026-10-26 15:23:25 +05:00
.editorconfig first commit 2026-10-26 14:55:48 +05:00
.envrc first commit 2026-10-26 14:55:48 +05:00
.gitignore first commit 2026-10-26 14:55:48 +05:00
bleur.toml first commit 2026-10-26 14:55:48 +05:00
Cargo.lock first commit 2026-10-26 14:55:48 +05:00
Cargo.toml first commit 2026-10-26 14:55:48 +05:00
default.nix first commit 2026-10-26 14:55:48 +05:00
flake.lock first commit 2026-10-26 14:55:48 +05:00
flake.nix first commit 2026-10-26 14:55:48 +05:00
readme.md first commit 2026-10-26 14:55:48 +05:00
rustfmt.toml first commit 2026-10-26 14:55:48 +05:00
shell.nix first commit 2026-10-26 14:55:48 +05:00

Rust Nix Template

This is a starter pack for Nix friendly Rust project ecosystem provided to you by Bleur Stack developers. The project uses rust toolchain derived from nixpkgs to fetch necessary tools and then compile your binary.

Please, after bootstrapping, rename / change all example or template keywords in template files.

Development

The project has shell.nix which has development environment preconfigured already for you. Just open your terminal and at the root of this project:

# Open in bash by default
nix develop

# If you want other shell
nix develop -c $SHELL

# After entering Nix development environment,
# inside the env, you can open your editor, so
# your editor will read all $PATH and environmental
# variables, also your terminal inside your editor
# will adopt all variables, so, you can close terminal.

# Neovim
vim .

# VSCode
code .

# Zed Editor
zed .

The development environment has whatever you may need already, but feel free to add or remove whatever inside shell.nix.

Building

Well, there are two ways of building your project. You can either go with classic cargo build way, but before that, make sure to enter development environment to have cargo and all rust toolchain available in your PATH, you may do like that:

# Entering development environment
nix develop -c $SHELL

# Compile the project
cargo build --release

Or, you can build your project via nix which will do all the dirty work for you. Just, in your terminal:

# Build in nix environment
nix build

# Executable binary is available at:
./result/bin/template

FAQ

Why not use default.nix for devShell?

There's been cases when I wanted to reproduce totally different behaviors in development environment and production build. This occurs quite a lot lately for some reason and because of that, I tend to keep both shell.nix and default.nix to don't mix things up.