Skip to content

Templates

Every example of this project is also a flake template, so each one can be instantiated into an empty directory with nix flake init. The Getting started chapter walks through the first steps with one of them.

Simple conan-flake project with only a flake-parts-based configuration

Section titled “Simple conan-flake project with only a flake-parts-based configuration”

This template will get you only the flake.nix, .envrc and .gitignore files.

Terminal window
mkdir -p default && cd default
nix flake init -t "git+https://codeberg.org/tarcisio/conan-flake"

C++ conan-flake, flake-parts-based project

Section titled “C++ conan-flake, flake-parts-based project”

Alongside the files from the previous item, this template will provide you also with a complete sample Conan-based C++ project.

Terminal window
mkdir -p example && cd example
git init
nix flake init -t "git+https://codeberg.org/tarcisio/conan-flake"#templates.example
direnv allow .

After this initial setup is complete, test if everything is working:

Terminal window
conan create . --build=missing

The remaining templates in this chapter can be initialized and validated in a similar manner.

This template is also flake-parts-based; see the LLVM chapter.

Terminal window
nix flake init -t "git+https://codeberg.org/tarcisio/conan-flake"#templates.llvm

C++ conan-flake, “devenv with flake-parts”-based project

Section titled “C++ conan-flake, “devenv with flake-parts”-based project”
Terminal window
nix flake init -t "git+https://codeberg.org/tarcisio/conan-flake"#templates.devenv
Terminal window
nix flake init -t "git+https://codeberg.org/tarcisio/conan-flake"#templates.devenv-module

C++ conan-flake, devenv-based project featuring a local-recipe-index remote

Section titled “C++ conan-flake, devenv-based project featuring a local-recipe-index remote”
Terminal window
nix flake init -t "git+https://codeberg.org/tarcisio/conan-flake"#templates.devenv-module-recipe

C++ conan-flake standalone Nix module project

Section titled “C++ conan-flake standalone Nix module project”

See the Standalone chapter.

Terminal window
nix flake init -t "git+https://codeberg.org/tarcisio/conan-flake"#templates.standalone

C++ conan-flake, flake-parts-based project demonstrating CUDA integration

Section titled “C++ conan-flake, flake-parts-based project demonstrating CUDA integration”

See the CUDA chapter.

Terminal window
nix flake init -t "git+https://codeberg.org/tarcisio/conan-flake"#templates.cuda