Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
c3ca945
Add conan-flake module
tarc May 6, 2026
0c7b955
Auto generate docs/src/reference/options.md
github-actions[bot] May 6, 2026
d3ac3c2
Add Conan entry to .nav.yml
tarc May 6, 2026
c8c119b
Improve docs
tarc May 6, 2026
9cc9f79
Merge branch 'cachix:main' into feature/conan-flake
tarc May 6, 2026
616a6a9
Merge branch 'cachix:main' into feature/conan-flake
tarc May 7, 2026
2d90ac4
Merge branch 'cachix:main' into feature/conan-flake
tarc May 8, 2026
4f8b0c4
Merge branch 'cachix:main' into feature/conan-flake
tarc May 9, 2026
452ec3f
Improve README.md
tarc May 9, 2026
ed0323e
Merge branch 'cachix:main' into feature/conan-flake
tarc May 11, 2026
4fee351
Merge branch 'cachix:main' into feature/conan-flake
tarc May 12, 2026
d45dea5
Merge branch 'cachix:main' into feature/conan-flake
tarc May 15, 2026
62e6db6
Auto generate docs/src/reference/options.md
github-actions[bot] May 15, 2026
c9ccee0
Improve nonsense comment
tarc May 15, 2026
2e4cfe5
Merge branch 'cachix:main' into feature/conan-flake
tarc May 17, 2026
327cdeb
Merge branch 'cachix:main' into feature/conan-flake
tarc May 18, 2026
171a53a
Merge branch 'cachix:main' into feature/conan-flake
tarc May 19, 2026
01a6c0b
Merge branch 'cachix:main' into feature/conan-flake
tarc May 20, 2026
048d3b6
Merge branch 'cachix:main' into feature/conan-flake
tarc May 21, 2026
eb80d3e
Add cplusplus test
tarc May 21, 2026
80c1f01
Parameterize language.cplusplus
tarc May 21, 2026
07067b1
Add conan package option to lanaguages.cplusplus
tarc May 21, 2026
7f47811
Merge branch 'cachix:main' into feature/conan-flake
tarc May 21, 2026
3cd356e
Auto generate docs/src/reference/options.md
github-actions[bot] May 21, 2026
00b3fe7
Auto generate missing individual markdowns
github-actions[bot] May 21, 2026
ae07f09
Add lanaguages.cplusplus.conan docs
tarc May 21, 2026
48bfd67
Merge branch 'cachix:main' into feature/conan-flake
tarc May 21, 2026
e52ebbd
Auto generate docs/src/reference/options.md
github-actions[bot] May 21, 2026
16192e9
Auto generate missing individual markdowns
github-actions[bot] May 21, 2026
c349360
Fix references
tarc May 22, 2026
b571642
Auto generate missing individual markdowns
github-actions[bot] May 22, 2026
06b6c19
Fix references again...
tarc May 22, 2026
727e096
Auto generate missing individual markdowns
github-actions[bot] May 22, 2026
9fbfcb7
Improve docs and tests
tarc May 22, 2026
2b36151
Auto generate missing individual markdowns
github-actions[bot] May 22, 2026
12aadd4
Improve docs and tests
tarc May 22, 2026
32ca00a
Auto generate missing individual markdowns
github-actions[bot] May 22, 2026
a6dbeb0
Improve tests
tarc May 22, 2026
b10a545
Test clang is default cplusplus compiler by default
tarc May 22, 2026
61f94d4
Fix zig docs (enumeration was broken)
tarc May 22, 2026
255ac6e
Auto generate missing individual markdowns
github-actions[bot] May 22, 2026
b71825f
Merge branch 'cachix:main' into feature/conan-flake
tarc May 22, 2026
5f50dfd
Merge branch 'cachix:main' into feature/conan-flake
tarc May 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 129 additions & 0 deletions docs/src/individual-docs/languages/cplusplus.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,133 @@
## Getting Started

The easiest way to get started with C++ is to simply enable it:

```nix
languages.cplusplus = {
enable = true;
};
```

This will automatically:

- Use `clang` as the default C++ package
- Install it along with CMake and other tools

Alternatively, you can manually specify packages:

```nix
languages.cplusplus = {
enable = true;
package = pkgs.stdenv.cc;
};
```

## Setting up the [Conan](https://conan.io/) package manager

Add `conan-flake` to your inputs:

```shell-session
$ devenv inputs add conan-flake git+https://codeberg.org/tarcisio/conan-flake
```

You can check [the list of available options](/reference/options.md#languagescplusplusconanenable). The [`languages.cplusplus.conan.config`](/reference/options.md#languagescplusplusconanconfig) option, however, maps the whole of the options available in the [`conan-flake`](https://flake.parts/options/conan-flake.html) module — check the [official module documentation](https://flake.parts/options/conan-flake.html#options) and see the examples in [conan-flake's README file](https://codeberg.org/tarcisio/conan-flake/src/branch/main/README.md) to help you setting up.

Config the `devenv.nix` file accordingly. For example:

```nix
languages.cplusplus = {
enable = true;
conan = {
enable = true;
install.enable = true;
};
};
```

By default, when Conan is enabled:

- The default C++ package is set to `config.stdenv.cc`
- Conan is configured to use the same CMake available in the developmemnt shell

### In Action:

```shell-session
$ devenv shell
Building shell ...
Entering shell ...

conan profile show # This would show the default profile.
```

## Additional Examples

### LLVM-based C++ Toolchain

If you would like to integrate with the LLVM compiler infrastructure:

```nix
{ pkgs, ... }:

{
languages.cplusplus = {
enable = true;
conan = {
enable = true;
install.enable = true;
config = {
stdenv = pkgs.overrideCC
(
pkgs.llvmPackages.libcxxStdenv.override {
targetPlatform.useLLVM = true;
}
)
pkgs.llvmPackages.clangUseLLVM;
# By default: compiler.libcxx=libstdc++11, so undo it:
compilerLibCxx = null;
};
};
};
}
```

Or even:

```nix
{ pkgs, ... }:

{
stdenv = pkgs.overrideCC
(
pkgs.llvmPackages.libcxxStdenv.override {
targetPlatform.useLLVM = true;
}
)
pkgs.llvmPackages.clangUseLLVM;

languages.cplusplus = {
enable = true;
conan = {
enable = true;
install.enable = true;
config = {
# By default: compiler.libcxx=libstdc++11, so undo it:
compilerLibCxx = null;
};
};
};
}
```

### In Action:

```shell-session
$ devenv shell
Building shell ...
Entering shell ...

conan profile show # This would show the default profile.
conan create . --build=missing # This would create and test the current package.
```

[comment]: # (Please add your documentation on top of this line)

Expand Down
1 change: 1 addition & 0 deletions docs/src/individual-docs/languages/zig.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ languages.zig = {
```

This will automatically:

- Use the specified Zig version from zig-overlay
- Install the corresponding ZLS version (e.g., version "0.15.1" uses ZLS 0.15.0)

Expand Down
Loading