Rust project template
Find a file Use this template
2026-02-13 19:42:55 +01:00
src Init 2026-02-13 19:42:55 +01:00
.dir-locals.el feat(emacs): add project-local variables 2025-11-20 13:07:16 +01:00
.envrc feat(env): define envrc 2025-11-20 13:07:32 +01:00
.gitignore feat: init code 2025-11-20 12:26:51 +01:00
Cargo.lock Init 2026-02-13 19:42:55 +01:00
Cargo.toml Init 2026-02-13 19:42:55 +01:00
channels-lock.scm feat(build): define Guix package and manifest 2025-11-20 13:07:45 +01:00
channels.scm feat(build): define Guix package and manifest 2025-11-20 13:07:45 +01:00
LICENSE Initial commit 2025-11-20 10:27:28 +01:00
Makefile feat(env): add Makefile for updating Guix refs 2025-11-20 13:08:00 +01:00
manifest.scm feat(build): define Guix package and manifest 2025-11-20 13:07:45 +01:00
package.scm feat(build): define Guix package and manifest 2025-11-20 13:07:45 +01:00
README.md docs: update README 2025-11-20 13:13:39 +01:00

Rust template project

This repository provides a template for Rust projects where the development environment is fully managed using GNU Guix.

The project structure is designed to cleany integrate Rust, Guix and Direnv.

Project structure

  • src/ Contains the Rust source files.
  • Cargo.toml and Cargo.lock Standard Rust/Cargo files defining the package and locking dependency versions.
  • .envrc Configures Direnv to automatically load the development environment defined in manifest.scm through Guix.
  • .dir-locals.el Local Emacs settings (e.g., integration with Guix, Direnv, and Rust tooling).
  • Makefile Provides utility commands; in particular, a target to conveniently update Guix channel references (or lock files).
  • package.scm Defines the project as a Guix package, making it installable on the system. Dependencies are automatically inferred from Cargo.lock.
  • channels.scm Lists the Guix channels used by the project.
  • channels-lock.scm Auto-generated file containing the exact revisions of the channels in use.
  • manifest.scm Defines the Guix-based development environment.

Development environment

The development environment is defined declaratively in manifest.scm, which lists all required tools and libraries.

By relying on GNU Guix, the project guarantees:

  • Reproducibility: everyone uses exactly the same compiler, tools, and library versions.
  • Isolated development: the environment does not interfere with system packages.
  • Easy onboarding: a single command sets everything up.

The most convenient method to access the development environment is to use direnv on the host machine. With direnv installed and enabled in your shell, the project directory will automatically load the Guix environment described in manifest.scm upon entry, and unload it when leaving the directory. This avoids running guix shell ... manually each time.

Without direnv, to manually enter in the development environment:

guix time-machine -C channels-lock.scm -- shell -m manifest.scm

Whenever the dependencies change, you can update the development shell with:

make update-env