No description
Find a file Use this template
2025-11-19 21:58:31 +01:00
src feat(meson): Added meson files 2025-11-18 18:42:58 +01:00
subprojects feat(meson): Added meson files 2025-11-18 18:42:58 +01:00
test feat(meson): Added meson files 2025-11-18 18:42:58 +01:00
.clang-format feat(clang-tools): added configurations 2025-11-18 18:38:08 +01:00
.clang-tidy feat(clang-tools): added configurations 2025-11-18 18:38:08 +01:00
.dir-locals.el feat(emacs): added Emacs dir-locals 2025-11-18 18:38:32 +01:00
.envrc feat(env): Added direnv configuration 2025-11-18 18:38:43 +01:00
.gitignore feat(git): Added gitignores 2025-11-18 18:42:46 +01:00
channels-lock.scm feat(env): Added Guix manifest 2025-11-18 18:39:16 +01:00
channels.scm feat(env): Added Guix manifest 2025-11-18 18:39:16 +01:00
LICENSE Initial commit 2025-11-18 17:24:39 +01:00
Makefile feat: Added Makefile 2025-11-18 18:43:09 +01:00
manifest.scm feat(env): Added Guix manifest 2025-11-18 18:39:16 +01:00
meson.build feat(build): use C++26 compile flag 2025-11-19 21:58:31 +01:00
README.md feat(docs): Init README 2025-11-18 18:43:21 +01:00

C++ Project Template

This repository provides a minimal template for a C++ project, including source code, unit tests, and a reproducible development environment powered by Guix.

Project structure

  • src/ contains all C++ source files;
  • test/ contains all unit tests;
  • .clang-format contains the project-local clang-format settings;
  • .clang-tidy contains the project-local clang-tidy settings;
  • .envrc configures the host's direnv to use the Guix environment;
  • manifest.scm defines the development environment using Guix:
    • channels.scm contains the list of channels referred in the manifest;
    • channels-lock.scm is the auto-generated list of channels versions referred in the environment;
  • meson.build is the entry-point of the Meson's project configuration;
  • .dir-locals.el contains project-local definitions useful for Emacs;
  • Makefile contains the set of most frequent commands for this project.

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

Makefile commands

For convenience, the Makefile includes all essential project commands:

  • make setup: configure the project environment;
  • make build: compile the project;
  • make test: build and run all unit tests;
  • make clear: clean the project directory;
  • make update-env: update the development environment dependencies (the channels-lock.scm file);