From c3ca945089179117a4c2b8f480ae1ebb4549651c Mon Sep 17 00:00:00 2001 From: tarcisio Date: Wed, 6 May 2026 00:42:47 +0000 Subject: [PATCH 01/48] Add conan-flake module --- docs/src/integrations/conan.md | 89 ++++++++++++++++++++++++++++++ src/modules/integrations/conan.nix | 49 ++++++++++++++++ tests/conan/devenv.nix | 21 +++++++ tests/conan/devenv.yaml | 3 + 4 files changed, 162 insertions(+) create mode 100644 docs/src/integrations/conan.md create mode 100644 src/modules/integrations/conan.nix create mode 100644 tests/conan/devenv.nix create mode 100644 tests/conan/devenv.yaml diff --git a/docs/src/integrations/conan.md b/docs/src/integrations/conan.md new file mode 100644 index 000000000..ed0fbc08b --- /dev/null +++ b/docs/src/integrations/conan.md @@ -0,0 +1,89 @@ +# `devenv` Integration for [Conan](https://conan.io/) via [conan-flake](https://codeberg.org/tarcisio/conan-flake) + +## Set up + +Add `conan-flake` to your inputs: + +```shell-session +$ devenv inputs add conan-flake git+https://codeberg.org/tarcisio/conan-flake +``` + +Check [the list of available options](/reference/options.md#conanenable). + +Config the `devenv.nix` file accordingly. For example, the following code would configure Conan to use the same CMake available in the developmemnt shell: + +```nix +{ inputs, ... }: + +{ + conan = { + enable = true; + config = { + platformToolRequires = { + cmake = pkgs.cmake.version; + }; + devShell = { + packages = [ + pkgs.cmake + ]; + }; + }; + }; +} +``` + +### In Action: + +```shell-session +$ devenv shell +Building shell ... +Entering shell ... + +conan profile show # This would show the default profile. +``` + +## Additional Devenv Config Examples + +### LLVM-based C++ Toolchain + +If you would like to integrate with the LLVM compiler infrastructure: + +```nix +{ inputs, pkgs, ... }: + +{ + conan = { + 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; + platformToolRequires = { + cmake = pkgs.cmake.version; + }; + devShell = { + packages = [ + pkgs.cmake + ]; + }; + }; + }; +} +``` + +### 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. +``` diff --git a/src/modules/integrations/conan.nix b/src/modules/integrations/conan.nix new file mode 100644 index 000000000..560b39488 --- /dev/null +++ b/src/modules/integrations/conan.nix @@ -0,0 +1,49 @@ +{ pkgs +, lib +, config +, ... +}: +let + cfg = config.conan; + + inputArgs = { + name = "conan-flake"; + url = "git+https://codeberg.org/tarcisio/conan-flake"; + attribute = "conan"; + }; + + # When enabled, use getInput (throws helpful error if missing) + # Otherwise, use tryGetInput to populate the docs when the input is available. + conan-flake = + if cfg.enable then config.lib.getInput inputArgs else config.lib.tryGetInput inputArgs; + + # Determine config root: prefer git.root, fallback to devenv.root + configRoot = if config.git.root != null then config.git.root else config.devenv.root; + + conanSubmodule = + if conan-flake != null then + # We automatically configure Conan with the correct tree root for the project. + conan-flake.lib.submoduleWith pkgs { inherit configRoot; } + else + lib.types.attrs; +in +{ + options.conan = { + enable = lib.mkEnableOption "conan integration (through conan-flake)"; + + config = lib.mkOption { + description = "conan configuration."; + type = conanSubmodule; + default = { }; + }; + }; + + config = lib.mkIf cfg.enable { + + # conan-flake exposes an `outputs.devShell` devShell by default that can be + # used directly, or passed in the inputsFrom option as a means to compose + # with other devShell modules. + inputsFrom = [ cfg.config.outputs.devShell ]; + + }; +} diff --git a/tests/conan/devenv.nix b/tests/conan/devenv.nix new file mode 100644 index 000000000..8ff41749d --- /dev/null +++ b/tests/conan/devenv.nix @@ -0,0 +1,21 @@ +{ pkgs, ... }: + +{ + conan = { + enable = true; + config = { + platformToolRequires = { + cmake = pkgs.cmake.version; + }; + devShell = { + packages = [ + pkgs.cmake + ]; + }; + }; + }; + + enterTest = '' + conan profile show | grep "cmake/"${pkgs.lib.escapeShellArg pkgs.cmake.version} + ''; +} diff --git a/tests/conan/devenv.yaml b/tests/conan/devenv.yaml new file mode 100644 index 000000000..0a9fd6c94 --- /dev/null +++ b/tests/conan/devenv.yaml @@ -0,0 +1,3 @@ +inputs: + conan-flake: + url: git+https://codeberg.org/tarcisio/conan-flake From 0c7b9555af0958c48956a08863926c93263e12ee Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 6 May 2026 01:16:12 +0000 Subject: [PATCH 02/48] Auto generate docs/src/reference/options.md --- docs/src/reference/options.md | 68 +++++++++++++++++++++++++++++++---- 1 file changed, 62 insertions(+), 6 deletions(-) diff --git a/docs/src/reference/options.md b/docs/src/reference/options.md index af6530cfe..9f98d50fb 100644 --- a/docs/src/reference/options.md +++ b/docs/src/reference/options.md @@ -2562,6 +2562,62 @@ list of string +## conan.enable + + + +Whether to enable conan integration (through conan-flake). + + + +*Type:* +boolean + + + +*Default:* + +```nix +false +``` + + + +*Example:* + +```nix +true +``` + +*Declared by:* + - [https://github.com/cachix/devenv/blob/main/src/modules/integrations/conan.nix](https://github.com/cachix/devenv/blob/main/src/modules/integrations/conan.nix) + + + +## conan.config + + + +conan configuration. + + + +*Type:* +attribute set + + + +*Default:* + +```nix +{ } +``` + +*Declared by:* + - [https://github.com/cachix/devenv/blob/main/src/modules/integrations/conan.nix](https://github.com/cachix/devenv/blob/main/src/modules/integrations/conan.nix) + + + ## container.isBuilding @@ -2718,8 +2774,6 @@ list of anything ## containers.\.fromImage - - An existing OCI base image to build on top of, built with nix2container’s pullImage. @@ -2766,6 +2820,8 @@ false ## containers.\.layers + + The layers to create. @@ -5971,8 +6027,6 @@ submodule ## git-hooks.hooks.biome.enable - - Whether to enable this pre-commit hook. @@ -6031,6 +6085,8 @@ null or string or absolute path ## git-hooks.hooks.biome.settings.configPath + + Path to the configuration JSON file @@ -8244,8 +8300,6 @@ false ## git-hooks.hooks.isort.settings.flags - - Flags passed to isort. See all available [here](https://pycqa.github.io/isort/docs/configuration/options.html). @@ -8292,6 +8346,8 @@ one of “”, “black”, “django”, “pycharm”, “google”, “open_s ## git-hooks.hooks.lacheck + + lacheck hook From d3ac3c26bfd21a2fb64f580431b087d096834e80 Mon Sep 17 00:00:00 2001 From: tarcisio Date: Wed, 6 May 2026 17:45:31 +0000 Subject: [PATCH 03/48] Add Conan entry to .nav.yml --- docs/src/integrations/.nav.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/src/integrations/.nav.yml b/docs/src/integrations/.nav.yml index bbb78632c..cea28625e 100644 --- a/docs/src/integrations/.nav.yml +++ b/docs/src/integrations/.nav.yml @@ -11,3 +11,4 @@ nav: - Difftastic: difftastic.md - Delta: delta.md - treefmt: treefmt.md + - Conan: conan.md From c8c119b1a6a65d22c391654b6c7845bb77830fab Mon Sep 17 00:00:00 2001 From: tarcisio Date: Wed, 6 May 2026 18:56:39 +0000 Subject: [PATCH 04/48] Improve docs --- docs/src/integrations/conan.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/src/integrations/conan.md b/docs/src/integrations/conan.md index ed0fbc08b..9773fe05f 100644 --- a/docs/src/integrations/conan.md +++ b/docs/src/integrations/conan.md @@ -1,4 +1,4 @@ -# `devenv` Integration for [Conan](https://conan.io/) via [conan-flake](https://codeberg.org/tarcisio/conan-flake) +# `devenv` Integration for [Conan](https://conan.io/) via [`conan-flake`](https://codeberg.org/tarcisio/conan-flake) ## Set up @@ -8,7 +8,7 @@ Add `conan-flake` to your inputs: $ devenv inputs add conan-flake git+https://codeberg.org/tarcisio/conan-flake ``` -Check [the list of available options](/reference/options.md#conanenable). +Check [the list of available options](/reference/options.md#conanenable). The [`conan.config`](/reference/options.md#conanconfig) option maps the whole of the options available in the [`conan-flake`](https://codeberg.org/tarcisio/conan-flake) module — see the examples in [conan-flake's README file](https://codeberg.org/tarcisio/conan-flake/src/branch/main/README.md) to get a grasp on the available options. Config the `devenv.nix` file accordingly. For example, the following code would configure Conan to use the same CMake available in the developmemnt shell: @@ -42,7 +42,7 @@ Entering shell ... conan profile show # This would show the default profile. ``` -## Additional Devenv Config Examples +## Additional Examples ### LLVM-based C++ Toolchain From 452ec3fe0d91aa1d2c5a9b152e4cc18a7ade3dd7 Mon Sep 17 00:00:00 2001 From: tarcisio Date: Sat, 9 May 2026 17:38:43 +0000 Subject: [PATCH 05/48] Improve README.md --- docs/src/integrations/conan.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/integrations/conan.md b/docs/src/integrations/conan.md index 9773fe05f..e06a2138e 100644 --- a/docs/src/integrations/conan.md +++ b/docs/src/integrations/conan.md @@ -8,7 +8,7 @@ Add `conan-flake` to your inputs: $ devenv inputs add conan-flake git+https://codeberg.org/tarcisio/conan-flake ``` -Check [the list of available options](/reference/options.md#conanenable). The [`conan.config`](/reference/options.md#conanconfig) option maps the whole of the options available in the [`conan-flake`](https://codeberg.org/tarcisio/conan-flake) module — see the examples in [conan-flake's README file](https://codeberg.org/tarcisio/conan-flake/src/branch/main/README.md) to get a grasp on the available options. +You can check [the list of available options](/reference/options.md#conanenable). The [`conan.config`](/reference/options.md#conanconfig) 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, the following code would configure Conan to use the same CMake available in the developmemnt shell: From 62e6db6741b71e733fea893bb78397b7e91e2820 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 15 May 2026 14:24:20 +0000 Subject: [PATCH 06/48] Auto generate docs/src/reference/options.md --- docs/src/reference/options.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/reference/options.md b/docs/src/reference/options.md index 4f610079d..1c2980e89 100644 --- a/docs/src/reference/options.md +++ b/docs/src/reference/options.md @@ -3649,7 +3649,7 @@ string *Default:* ```nix -"2.1.0" +"2.1.2" ``` *Declared by:* From c9ccee05aa22eeac0682d305f84e26963672bcaa Mon Sep 17 00:00:00 2001 From: tarcisio Date: Fri, 15 May 2026 14:49:11 +0000 Subject: [PATCH 07/48] Improve nonsense comment --- src/modules/integrations/conan.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/integrations/conan.nix b/src/modules/integrations/conan.nix index 560b39488..efa4b77d8 100644 --- a/src/modules/integrations/conan.nix +++ b/src/modules/integrations/conan.nix @@ -40,9 +40,9 @@ in config = lib.mkIf cfg.enable { - # conan-flake exposes an `outputs.devShell` devShell by default that can be - # used directly, or passed in the inputsFrom option as a means to compose - # with other devShell modules. + # conan-flake exposes `outputs.devShell` by default that can be used + # directly, or passed in the inputsFrom option as a means to compose with + # other devShell modules. inputsFrom = [ cfg.config.outputs.devShell ]; }; From eb80d3ecbc25d89040a50254a3533e41eb52402e Mon Sep 17 00:00:00 2001 From: tarcisio Date: Thu, 21 May 2026 17:41:55 +0000 Subject: [PATCH 08/48] Add cplusplus test --- tests/cplusplus/devenv.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/cplusplus/devenv.nix diff --git a/tests/cplusplus/devenv.nix b/tests/cplusplus/devenv.nix new file mode 100644 index 000000000..5be70d463 --- /dev/null +++ b/tests/cplusplus/devenv.nix @@ -0,0 +1,14 @@ +{ pkgs, config, ... }: + +{ + languages.cplusplus.enable = true; + enterTest = '' + clang --version + cmake --version + ccls --version | grep ${pkgs.lib.escapeShellArg config.languages.cplusplus.lsp.package.version} + # Validate some clang-tools are in the path: + clang-doc --version + clang-format --version + clang-tidy --version + ''; +} From 80c1f01851aed6cf3adc61aed3f0ea606af8425d Mon Sep 17 00:00:00 2001 From: tarcisio Date: Thu, 21 May 2026 17:52:40 +0000 Subject: [PATCH 09/48] Parameterize language.cplusplus --- src/modules/languages/cplusplus.nix | 42 ++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/src/modules/languages/cplusplus.nix b/src/modules/languages/cplusplus.nix index e67933276..6e6eb7990 100644 --- a/src/modules/languages/cplusplus.nix +++ b/src/modules/languages/cplusplus.nix @@ -7,6 +7,39 @@ in options.languages.cplusplus = { enable = lib.mkEnableOption "tools for C++ development"; + package = lib.mkOption { + type = lib.types.package; + default = pkgs.clang; + defaultText = lib.literalExpression "pkgs.clang"; + description = "The C++ compiler to use."; + }; + + cmake = lib.mkOption { + type = lib.types.submodule { + options.package = lib.mkOption { + type = lib.types.package; + default = pkgs.cmake; + defaultText = lib.literalExpression "pkgs.cmake"; + description = "The CMake package to use."; + }; + }; + description = "Configuration for cmake"; + default = { }; + }; + + tools = { + enable = lib.mkEnableOption "Standalone command line tools for C++ development" // { + default = cfg.package.isClang; + defaultText = lib.literalMD "Enabled by default for clang-based compilers"; + }; + package = lib.mkOption { + type = lib.types.package; + default = pkgs.clang-tools; + defaultText = lib.literalExpression "pkgs.clang-tools"; + description = "The C++ command line tools package to use."; + }; + }; + lsp = { enable = lib.mkEnableOption "C++ Language Server" // { default = true; }; package = lib.mkOption { @@ -20,9 +53,10 @@ in config = lib.mkIf cfg.enable { packages = with pkgs; [ - clang-tools - cmake - clang - ] ++ lib.optional cfg.lsp.enable cfg.lsp.package; + cfg.cmake.package + cfg.package + ] + ++ lib.optional cfg.tools.enable cfg.tools.package + ++ lib.optional cfg.lsp.enable cfg.lsp.package; }; } From 07067b1b481347afc566c7938c7e5312a0d55f71 Mon Sep 17 00:00:00 2001 From: tarcisio Date: Thu, 21 May 2026 22:35:59 +0000 Subject: [PATCH 10/48] Add conan package option to lanaguages.cplusplus --- src/modules/languages/cplusplus.nix | 70 +++++++++++++++++++++++++---- tests/cplusplus-conan/devenv.nix | 14 ++++++ tests/cplusplus-conan/devenv.yaml | 3 ++ 3 files changed, 79 insertions(+), 8 deletions(-) create mode 100644 tests/cplusplus-conan/devenv.nix create mode 100644 tests/cplusplus-conan/devenv.yaml diff --git a/src/modules/languages/cplusplus.nix b/src/modules/languages/cplusplus.nix index 6e6eb7990..6be1f254c 100644 --- a/src/modules/languages/cplusplus.nix +++ b/src/modules/languages/cplusplus.nix @@ -2,6 +2,27 @@ let cfg = config.languages.cplusplus; + + inputArgs = { + name = "conan-flake"; + url = "git+https://codeberg.org/tarcisio/conan-flake"; + attribute = "conan"; + }; + + # When enabled, use getInput (throws helpful error if missing) + # Otherwise, use tryGetInput to populate the docs when the input is available. + conan-flake = + if cfg.conan.enable then config.lib.getInput inputArgs else config.lib.tryGetInput inputArgs; + + # Determine config root: prefer git.root, fallback to devenv.root + configRoot = if config.git.root != null then config.git.root else config.devenv.root; + + conanSubmodule = + if conan-flake != null then + # We automatically configure Conan with the correct tree root for the project. + conan-flake.lib.submoduleWith pkgs { inherit configRoot; } + else + lib.types.attrs; in { options.languages.cplusplus = { @@ -40,6 +61,22 @@ in }; }; + conan = { + enable = lib.mkEnableOption "install conan"; + package = lib.mkOption { + type = lib.types.package; + default = pkgs.conan; + defaultText = lib.literalExpression "pkgs.conan"; + description = "The conan package to use."; + }; + config = lib.mkOption { + type = conanSubmodule; + description = "conan configuration."; + default = { }; + }; + install.enable = lib.mkEnableOption "conan install during devenv initialisation"; + }; + lsp = { enable = lib.mkEnableOption "C++ Language Server" // { default = true; }; package = lib.mkOption { @@ -51,12 +88,29 @@ in }; }; - config = lib.mkIf cfg.enable { - packages = with pkgs; [ - cfg.cmake.package - cfg.package - ] - ++ lib.optional cfg.tools.enable cfg.tools.package - ++ lib.optional cfg.lsp.enable cfg.lsp.package; - }; + config = lib.mkMerge [ + (lib.mkIf cfg.enable { + packages = with pkgs; [ + cfg.cmake.package + cfg.package + ] + ++ lib.optional cfg.tools.enable cfg.tools.package + ++ lib.optional cfg.lsp.enable cfg.lsp.package; + }) + + # + (lib.mkIf (cfg.enable && cfg.conan.enable) { + languages.cplusplus.conan.config.stdenv = lib.mkDefault config.stdenv; + languages.cplusplus.conan.config.package = lib.mkDefault cfg.conan.package; + languages.cplusplus.conan.config.platformToolRequires = lib.mkDefault { + cmake = cfg.cmake.package.version; + }; + languages.cplusplus.package = lib.mkDefault cfg.conan.config.stdenv.cc; + }) + + # + (lib.mkIf (cfg.enable && cfg.conan.enable && cfg.conan.install.enable) { + inputsFrom = [ cfg.conan.config.outputs.devShell ]; + }) + ]; } diff --git a/tests/cplusplus-conan/devenv.nix b/tests/cplusplus-conan/devenv.nix new file mode 100644 index 000000000..e0290874d --- /dev/null +++ b/tests/cplusplus-conan/devenv.nix @@ -0,0 +1,14 @@ +{ pkgs, config, ... }: + +{ + languages.cplusplus.enable = true; + languages.cplusplus.conan.enable = true; + languages.cplusplus.conan.install.enable = true; + enterTest = '' + ${pkgs.lib.getExe config.languages.cplusplus.package} --version + ${pkgs.lib.getExe config.languages.cplusplus.cmake.package} --version + ${pkgs.lib.getExe config.languages.cplusplus.conan.package} --version + echo "enable:"${pkgs.lib.escapeShellArg config.languages.cplusplus.tools.enable}":" | grep "enable:"${pkgs.lib.escapeShellArg config.stdenv.cc.isClang}":" + ${pkgs.lib.getExe config.languages.cplusplus.conan.package} profile show | grep "cmake/"${pkgs.lib.escapeShellArg config.languages.cplusplus.cmake.package.version} + ''; +} diff --git a/tests/cplusplus-conan/devenv.yaml b/tests/cplusplus-conan/devenv.yaml new file mode 100644 index 000000000..0a9fd6c94 --- /dev/null +++ b/tests/cplusplus-conan/devenv.yaml @@ -0,0 +1,3 @@ +inputs: + conan-flake: + url: git+https://codeberg.org/tarcisio/conan-flake From 3cd356ee4f4556e58b2eaed8482e6630ea5c669a Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 21 May 2026 22:41:10 +0000 Subject: [PATCH 11/48] Auto generate docs/src/reference/options.md --- docs/src/reference/options.md | 237 ++++++++++++++++++++++++++++++++++ 1 file changed, 237 insertions(+) diff --git a/docs/src/reference/options.md b/docs/src/reference/options.md index 1c2980e89..188677ba3 100644 --- a/docs/src/reference/options.md +++ b/docs/src/reference/options.md @@ -14938,6 +14938,190 @@ false +*Example:* + +```nix +true +``` + +*Declared by:* + - [https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix](https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix) + + + +## languages.cplusplus.package + + + +The C++ compiler to use. + + + +*Type:* +package + + + +*Default:* + +```nix +pkgs.clang +``` + +*Declared by:* + - [https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix](https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix) + + + +## languages.cplusplus.cmake + + + +Configuration for cmake + + + +*Type:* +submodule + + + +*Default:* + +```nix +{ } +``` + +*Declared by:* + - [https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix](https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix) + + + +## languages.cplusplus.cmake.package + + + +The CMake package to use. + + + +*Type:* +package + + + +*Default:* + +```nix +pkgs.cmake +``` + +*Declared by:* + - [https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix](https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix) + + + +## languages.cplusplus.conan.enable + + + +Whether to enable install conan. + + + +*Type:* +boolean + + + +*Default:* + +```nix +false +``` + + + +*Example:* + +```nix +true +``` + +*Declared by:* + - [https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix](https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix) + + + +## languages.cplusplus.conan.package + + + +The conan package to use. + + + +*Type:* +package + + + +*Default:* + +```nix +pkgs.conan +``` + +*Declared by:* + - [https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix](https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix) + + + +## languages.cplusplus.conan.config + + + +conan configuration. + + + +*Type:* +attribute set + + + +*Default:* + +```nix +{ } +``` + +*Declared by:* + - [https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix](https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix) + + + +## languages.cplusplus.conan.install.enable + + + +Whether to enable conan install during devenv initialisation. + + + +*Type:* +boolean + + + +*Default:* + +```nix +false +``` + + + *Example:* ```nix @@ -15005,6 +15189,59 @@ pkgs.ccls +## languages.cplusplus.tools.enable + + + +Whether to enable Standalone command line tools for C++ development. + + + +*Type:* +boolean + + + +*Default:* +Enabled by default for clang-based compilers + + + +*Example:* + +```nix +true +``` + +*Declared by:* + - [https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix](https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix) + + + +## languages.cplusplus.tools.package + + + +The C++ command line tools package to use. + + + +*Type:* +package + + + +*Default:* + +```nix +pkgs.clang-tools +``` + +*Declared by:* + - [https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix](https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix) + + + ## languages.crystal.enable From 00b3fe7754df008f494734a21563e1a315837e80 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 21 May 2026 22:42:07 +0000 Subject: [PATCH 12/48] Auto generate missing individual markdowns --- docs/src/languages/cplusplus.md | 237 ++++++++++++++++++++++++++++++++ 1 file changed, 237 insertions(+) diff --git a/docs/src/languages/cplusplus.md b/docs/src/languages/cplusplus.md index a145d67f7..d52bea89d 100644 --- a/docs/src/languages/cplusplus.md +++ b/docs/src/languages/cplusplus.md @@ -7,6 +7,8 @@ ### languages\.cplusplus\.enable + + Whether to enable tools for C++ development\. @@ -24,6 +26,188 @@ false +*Example:* + +```nix +true +``` + +*Declared by:* + - [https://github\.com/cachix/devenv/blob/main/src/modules/languages/cplusplus\.nix](https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix) + + + +### languages\.cplusplus\.package + + + +The C++ compiler to use\. + + + +*Type:* +package + + + +*Default:* + +```nix +pkgs.clang +``` + +*Declared by:* + - [https://github\.com/cachix/devenv/blob/main/src/modules/languages/cplusplus\.nix](https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix) + + + +### languages\.cplusplus\.cmake + +Configuration for cmake + + + +*Type:* +submodule + + + +*Default:* + +```nix +{ } +``` + +*Declared by:* + - [https://github\.com/cachix/devenv/blob/main/src/modules/languages/cplusplus\.nix](https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix) + + + +### languages\.cplusplus\.cmake\.package + + + +The CMake package to use\. + + + +*Type:* +package + + + +*Default:* + +```nix +pkgs.cmake +``` + +*Declared by:* + - [https://github\.com/cachix/devenv/blob/main/src/modules/languages/cplusplus\.nix](https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix) + + + +### languages\.cplusplus\.conan\.enable + + + +Whether to enable install conan\. + + + +*Type:* +boolean + + + +*Default:* + +```nix +false +``` + + + +*Example:* + +```nix +true +``` + +*Declared by:* + - [https://github\.com/cachix/devenv/blob/main/src/modules/languages/cplusplus\.nix](https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix) + + + +### languages\.cplusplus\.conan\.package + + + +The conan package to use\. + + + +*Type:* +package + + + +*Default:* + +```nix +pkgs.conan +``` + +*Declared by:* + - [https://github\.com/cachix/devenv/blob/main/src/modules/languages/cplusplus\.nix](https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix) + + + +### languages\.cplusplus\.conan\.config + + + +conan configuration\. + + + +*Type:* +attribute set + + + +*Default:* + +```nix +{ } +``` + +*Declared by:* + - [https://github\.com/cachix/devenv/blob/main/src/modules/languages/cplusplus\.nix](https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix) + + + +### languages\.cplusplus\.conan\.install\.enable + + + +Whether to enable conan install during devenv initialisation\. + + + +*Type:* +boolean + + + +*Default:* + +```nix +false +``` + + + *Example:* ```nix @@ -88,3 +272,56 @@ pkgs.ccls *Declared by:* - [https://github\.com/cachix/devenv/blob/main/src/modules/languages/cplusplus\.nix](https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix) + + + +### languages\.cplusplus\.tools\.enable + + + +Whether to enable Standalone command line tools for C++ development\. + + + +*Type:* +boolean + + + +*Default:* +Enabled by default for clang-based compilers + + + +*Example:* + +```nix +true +``` + +*Declared by:* + - [https://github\.com/cachix/devenv/blob/main/src/modules/languages/cplusplus\.nix](https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix) + + + +### languages\.cplusplus\.tools\.package + + + +The C++ command line tools package to use\. + + + +*Type:* +package + + + +*Default:* + +```nix +pkgs.clang-tools +``` + +*Declared by:* + - [https://github\.com/cachix/devenv/blob/main/src/modules/languages/cplusplus\.nix](https://github.com/cachix/devenv/blob/main/src/modules/languages/cplusplus.nix) From ae07f09b47a4769dde698e58022a9d2adf777d44 Mon Sep 17 00:00:00 2001 From: tarcisio Date: Thu, 21 May 2026 23:41:54 +0000 Subject: [PATCH 13/48] Add lanaguages.cplusplus.conan docs --- .../individual-docs/languages/cplusplus.md | 109 ++++++++++++++++++ docs/src/integrations/.nav.yml | 1 - docs/src/integrations/conan.md | 89 -------------- src/modules/integrations/conan.nix | 49 -------- tests/conan/devenv.nix | 21 ---- tests/conan/devenv.yaml | 3 - 6 files changed, 109 insertions(+), 163 deletions(-) delete mode 100644 docs/src/integrations/conan.md delete mode 100644 src/modules/integrations/conan.nix delete mode 100644 tests/conan/devenv.nix delete mode 100644 tests/conan/devenv.yaml diff --git a/docs/src/individual-docs/languages/cplusplus.md b/docs/src/individual-docs/languages/cplusplus.md index d3615c80f..6ca2c7d94 100644 --- a/docs/src/individual-docs/languages/cplusplus.md +++ b/docs/src/individual-docs/languages/cplusplus.md @@ -1,4 +1,113 @@ +## 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#conanenable). The [`conan.config`](/reference/options.md#conanconfig) 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, the following code would configure Conan to use the same CMake available in the developmemnt shell: + +```nix +{ inputs, ... }: + +{ + conan = { + enable = true; + config = { + platformToolRequires = { + cmake = pkgs.cmake.version; + }; + devShell = { + packages = [ + pkgs.cmake + ]; + }; + }; + }; +} +``` + +#### 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 +{ inputs, pkgs, ... }: + +{ + conan = { + 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; + platformToolRequires = { + cmake = pkgs.cmake.version; + }; + devShell = { + packages = [ + pkgs.cmake + ]; + }; + }; + }; +} +``` + +### 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) diff --git a/docs/src/integrations/.nav.yml b/docs/src/integrations/.nav.yml index cea28625e..bbb78632c 100644 --- a/docs/src/integrations/.nav.yml +++ b/docs/src/integrations/.nav.yml @@ -11,4 +11,3 @@ nav: - Difftastic: difftastic.md - Delta: delta.md - treefmt: treefmt.md - - Conan: conan.md diff --git a/docs/src/integrations/conan.md b/docs/src/integrations/conan.md deleted file mode 100644 index e06a2138e..000000000 --- a/docs/src/integrations/conan.md +++ /dev/null @@ -1,89 +0,0 @@ -# `devenv` Integration for [Conan](https://conan.io/) via [`conan-flake`](https://codeberg.org/tarcisio/conan-flake) - -## Set up - -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#conanenable). The [`conan.config`](/reference/options.md#conanconfig) 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, the following code would configure Conan to use the same CMake available in the developmemnt shell: - -```nix -{ inputs, ... }: - -{ - conan = { - enable = true; - config = { - platformToolRequires = { - cmake = pkgs.cmake.version; - }; - devShell = { - packages = [ - pkgs.cmake - ]; - }; - }; - }; -} -``` - -### 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 -{ inputs, pkgs, ... }: - -{ - conan = { - 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; - platformToolRequires = { - cmake = pkgs.cmake.version; - }; - devShell = { - packages = [ - pkgs.cmake - ]; - }; - }; - }; -} -``` - -### 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. -``` diff --git a/src/modules/integrations/conan.nix b/src/modules/integrations/conan.nix deleted file mode 100644 index efa4b77d8..000000000 --- a/src/modules/integrations/conan.nix +++ /dev/null @@ -1,49 +0,0 @@ -{ pkgs -, lib -, config -, ... -}: -let - cfg = config.conan; - - inputArgs = { - name = "conan-flake"; - url = "git+https://codeberg.org/tarcisio/conan-flake"; - attribute = "conan"; - }; - - # When enabled, use getInput (throws helpful error if missing) - # Otherwise, use tryGetInput to populate the docs when the input is available. - conan-flake = - if cfg.enable then config.lib.getInput inputArgs else config.lib.tryGetInput inputArgs; - - # Determine config root: prefer git.root, fallback to devenv.root - configRoot = if config.git.root != null then config.git.root else config.devenv.root; - - conanSubmodule = - if conan-flake != null then - # We automatically configure Conan with the correct tree root for the project. - conan-flake.lib.submoduleWith pkgs { inherit configRoot; } - else - lib.types.attrs; -in -{ - options.conan = { - enable = lib.mkEnableOption "conan integration (through conan-flake)"; - - config = lib.mkOption { - description = "conan configuration."; - type = conanSubmodule; - default = { }; - }; - }; - - config = lib.mkIf cfg.enable { - - # conan-flake exposes `outputs.devShell` by default that can be used - # directly, or passed in the inputsFrom option as a means to compose with - # other devShell modules. - inputsFrom = [ cfg.config.outputs.devShell ]; - - }; -} diff --git a/tests/conan/devenv.nix b/tests/conan/devenv.nix deleted file mode 100644 index 8ff41749d..000000000 --- a/tests/conan/devenv.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ pkgs, ... }: - -{ - conan = { - enable = true; - config = { - platformToolRequires = { - cmake = pkgs.cmake.version; - }; - devShell = { - packages = [ - pkgs.cmake - ]; - }; - }; - }; - - enterTest = '' - conan profile show | grep "cmake/"${pkgs.lib.escapeShellArg pkgs.cmake.version} - ''; -} diff --git a/tests/conan/devenv.yaml b/tests/conan/devenv.yaml deleted file mode 100644 index 0a9fd6c94..000000000 --- a/tests/conan/devenv.yaml +++ /dev/null @@ -1,3 +0,0 @@ -inputs: - conan-flake: - url: git+https://codeberg.org/tarcisio/conan-flake From e52ebbd74aecc13903201f733a39f183e8eaeea9 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 21 May 2026 23:46:00 +0000 Subject: [PATCH 14/48] Auto generate docs/src/reference/options.md --- docs/src/reference/options.md | 68 ++++------------------------------- 1 file changed, 6 insertions(+), 62 deletions(-) diff --git a/docs/src/reference/options.md b/docs/src/reference/options.md index 51de33dd3..dee5573ea 100644 --- a/docs/src/reference/options.md +++ b/docs/src/reference/options.md @@ -2578,62 +2578,6 @@ list of string -## conan.enable - - - -Whether to enable conan integration (through conan-flake). - - - -*Type:* -boolean - - - -*Default:* - -```nix -false -``` - - - -*Example:* - -```nix -true -``` - -*Declared by:* - - [https://github.com/cachix/devenv/blob/main/src/modules/integrations/conan.nix](https://github.com/cachix/devenv/blob/main/src/modules/integrations/conan.nix) - - - -## conan.config - - - -conan configuration. - - - -*Type:* -attribute set - - - -*Default:* - -```nix -{ } -``` - -*Declared by:* - - [https://github.com/cachix/devenv/blob/main/src/modules/integrations/conan.nix](https://github.com/cachix/devenv/blob/main/src/modules/integrations/conan.nix) - - - ## container.isBuilding @@ -2790,6 +2734,8 @@ list of anything ## containers.\.fromImage + + An existing OCI base image to build on top of, built with nix2container’s pullImage. @@ -2836,8 +2782,6 @@ false ## containers.\.layers - - The layers to create. @@ -6043,6 +5987,8 @@ submodule ## git-hooks.hooks.biome.enable + + Whether to enable this pre-commit hook. @@ -6101,8 +6047,6 @@ null or string or absolute path ## git-hooks.hooks.biome.settings.configPath - - Path to the configuration JSON file @@ -8316,6 +8260,8 @@ false ## git-hooks.hooks.isort.settings.flags + + Flags passed to isort. See all available [here](https://pycqa.github.io/isort/docs/configuration/options.html). @@ -8362,8 +8308,6 @@ one of “”, “black”, “django”, “pycharm”, “google”, “open_s ## git-hooks.hooks.lacheck - - lacheck hook From 16192e9fdafda9f11dbb7792cad8b63eb41d07ea Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 21 May 2026 23:46:58 +0000 Subject: [PATCH 15/48] Auto generate missing individual markdowns --- docs/src/languages/cplusplus.md | 109 ++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/docs/src/languages/cplusplus.md b/docs/src/languages/cplusplus.md index d52bea89d..c8bb45d15 100644 --- a/docs/src/languages/cplusplus.md +++ b/docs/src/languages/cplusplus.md @@ -1,5 +1,114 @@ [comment]: # (Do not edit this file as it is autogenerated. Go to docs/individual-docs if you want to make edits.) +## 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#conanenable). The [`conan.config`](/reference/options.md#conanconfig) 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, the following code would configure Conan to use the same CMake available in the developmemnt shell: + +```nix +{ inputs, ... }: + +{ + conan = { + enable = true; + config = { + platformToolRequires = { + cmake = pkgs.cmake.version; + }; + devShell = { + packages = [ + pkgs.cmake + ]; + }; + }; + }; +} +``` + +#### 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 +{ inputs, pkgs, ... }: + +{ + conan = { + 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; + platformToolRequires = { + cmake = pkgs.cmake.version; + }; + devShell = { + packages = [ + pkgs.cmake + ]; + }; + }; + }; +} +``` + +### 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) From c349360c7f3de5259e84dbdfe45119121ef88b22 Mon Sep 17 00:00:00 2001 From: tarcisio Date: Fri, 22 May 2026 00:06:15 +0000 Subject: [PATCH 16/48] Fix references --- docs/src/individual-docs/languages/cplusplus.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/src/individual-docs/languages/cplusplus.md b/docs/src/individual-docs/languages/cplusplus.md index 6ca2c7d94..c0323a48b 100644 --- a/docs/src/individual-docs/languages/cplusplus.md +++ b/docs/src/individual-docs/languages/cplusplus.md @@ -21,7 +21,7 @@ languages.cplusplus = { }; ``` -### Setting up the [Conan](https://conan.io/) package manager +## Setting up the [Conan](https://conan.io/) package manager Add `conan-flake` to your inputs: @@ -29,7 +29,7 @@ Add `conan-flake` to your inputs: $ devenv inputs add conan-flake git+https://codeberg.org/tarcisio/conan-flake ``` -You can check [the list of available options](/reference/options.md#conanenable). The [`conan.config`](/reference/options.md#conanconfig) 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. +You can check [the list of available options](/reference/options/#languagescplusplusenable). The [`languages.cplusplus.conan.config`](/reference/options/#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, the following code would configure Conan to use the same CMake available in the developmemnt shell: @@ -53,7 +53,7 @@ Config the `devenv.nix` file accordingly. For example, the following code would } ``` -#### In Action: +### In Action: ```shell-session $ devenv shell From b5716421b64f97c07c330d4c7a4714c20c7121a7 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 00:10:24 +0000 Subject: [PATCH 17/48] Auto generate missing individual markdowns --- docs/src/languages/cplusplus.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/src/languages/cplusplus.md b/docs/src/languages/cplusplus.md index c8bb45d15..483708e21 100644 --- a/docs/src/languages/cplusplus.md +++ b/docs/src/languages/cplusplus.md @@ -22,7 +22,7 @@ languages.cplusplus = { }; ``` -### Setting up the [Conan](https://conan.io/) package manager +## Setting up the [Conan](https://conan.io/) package manager Add `conan-flake` to your inputs: @@ -30,7 +30,7 @@ Add `conan-flake` to your inputs: $ devenv inputs add conan-flake git+https://codeberg.org/tarcisio/conan-flake ``` -You can check [the list of available options](/reference/options.md#conanenable). The [`conan.config`](/reference/options.md#conanconfig) 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. +You can check [the list of available options](/reference/options/#languagescplusplusenable). The [`languages.cplusplus.conan.config`](/reference/options/#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, the following code would configure Conan to use the same CMake available in the developmemnt shell: @@ -54,7 +54,7 @@ Config the `devenv.nix` file accordingly. For example, the following code would } ``` -#### In Action: +### In Action: ```shell-session $ devenv shell From 06b6c19d321ce47a14320e2339e9fee36605462e Mon Sep 17 00:00:00 2001 From: tarcisio Date: Fri, 22 May 2026 00:13:56 +0000 Subject: [PATCH 18/48] Fix references again... --- docs/src/individual-docs/languages/cplusplus.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/individual-docs/languages/cplusplus.md b/docs/src/individual-docs/languages/cplusplus.md index c0323a48b..e7dfc5f2f 100644 --- a/docs/src/individual-docs/languages/cplusplus.md +++ b/docs/src/individual-docs/languages/cplusplus.md @@ -29,7 +29,7 @@ Add `conan-flake` to your inputs: $ devenv inputs add conan-flake git+https://codeberg.org/tarcisio/conan-flake ``` -You can check [the list of available options](/reference/options/#languagescplusplusenable). The [`languages.cplusplus.conan.config`](/reference/options/#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. +You can check [the list of available options](/reference/options.md#languagescplusplusenable). 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, the following code would configure Conan to use the same CMake available in the developmemnt shell: From 727e0967bd8c49588fec77842c2a82b1509062aa Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 00:18:16 +0000 Subject: [PATCH 19/48] Auto generate missing individual markdowns --- docs/src/languages/cplusplus.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/languages/cplusplus.md b/docs/src/languages/cplusplus.md index 483708e21..385045c46 100644 --- a/docs/src/languages/cplusplus.md +++ b/docs/src/languages/cplusplus.md @@ -30,7 +30,7 @@ Add `conan-flake` to your inputs: $ devenv inputs add conan-flake git+https://codeberg.org/tarcisio/conan-flake ``` -You can check [the list of available options](/reference/options/#languagescplusplusenable). The [`languages.cplusplus.conan.config`](/reference/options/#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. +You can check [the list of available options](/reference/options.md#languagescplusplusenable). 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, the following code would configure Conan to use the same CMake available in the developmemnt shell: From 9fbfcb7bf1e100bff75ee9b1463e25fc9d969ecd Mon Sep 17 00:00:00 2001 From: tarcisio Date: Fri, 22 May 2026 01:04:38 +0000 Subject: [PATCH 20/48] Improve docs and tests --- .../individual-docs/languages/cplusplus.md | 64 ++++++++----------- tests/cplusplus-conan-llvm-devenv/devenv.nix | 30 +++++++++ tests/cplusplus-conan-llvm-devenv/devenv.yaml | 3 + tests/cplusplus-conan-llvm/devenv.nix | 29 +++++++++ tests/cplusplus-conan-llvm/devenv.yaml | 3 + 5 files changed, 93 insertions(+), 36 deletions(-) create mode 100644 tests/cplusplus-conan-llvm-devenv/devenv.nix create mode 100644 tests/cplusplus-conan-llvm-devenv/devenv.yaml create mode 100644 tests/cplusplus-conan-llvm/devenv.nix create mode 100644 tests/cplusplus-conan-llvm/devenv.yaml diff --git a/docs/src/individual-docs/languages/cplusplus.md b/docs/src/individual-docs/languages/cplusplus.md index e7dfc5f2f..ba0f904f2 100644 --- a/docs/src/individual-docs/languages/cplusplus.md +++ b/docs/src/individual-docs/languages/cplusplus.md @@ -9,8 +9,9 @@ languages.cplusplus = { ``` This will automatically: + - Use `clang` as the default C++ package -- Install it along with `cmake` and other tools +- Install it along with CMake and other tools Alternatively, you can manually specify packages: @@ -29,30 +30,25 @@ Add `conan-flake` to your inputs: $ devenv inputs add conan-flake git+https://codeberg.org/tarcisio/conan-flake ``` -You can check [the list of available options](/reference/options.md#languagescplusplusenable). 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. +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, the following code would configure Conan to use the same CMake available in the developmemnt shell: +Config the `devenv.nix` file accordingly. For example: ```nix -{ inputs, ... }: - -{ +languages.cplusplus = { + enable = true; conan = { enable = true; - config = { - platformToolRequires = { - cmake = pkgs.cmake.version; - }; - devShell = { - packages = [ - pkgs.cmake - ]; - }; - }; + install.enable = true; }; -} +}; ``` +By default, when the Conan package 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 @@ -70,28 +66,24 @@ conan profile show # This would show the default profile. If you would like to integrate with the LLVM compiler infrastructure: ```nix -{ inputs, pkgs, ... }: +{ pkgs, ... }: { - conan = { + languages.cplusplus = { 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; - platformToolRequires = { - cmake = pkgs.cmake.version; - }; - devShell = { - packages = [ - pkgs.cmake - ]; + 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; }; }; }; diff --git a/tests/cplusplus-conan-llvm-devenv/devenv.nix b/tests/cplusplus-conan-llvm-devenv/devenv.nix new file mode 100644 index 000000000..bd7f66f43 --- /dev/null +++ b/tests/cplusplus-conan-llvm-devenv/devenv.nix @@ -0,0 +1,30 @@ +{ pkgs, config, ... }: + +{ + 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; + }; + }; + }; + enterTest = '' + ${pkgs.lib.getExe config.languages.cplusplus.package} --version + ${pkgs.lib.getExe config.languages.cplusplus.cmake.package} --version + ${pkgs.lib.getExe config.languages.cplusplus.conan.package} --version + echo "enable:"${pkgs.lib.escapeShellArg config.languages.cplusplus.tools.enable}":" | grep "enable:1:" + ${pkgs.lib.getExe config.languages.cplusplus.conan.package} profile show | grep "cmake/"${pkgs.lib.escapeShellArg config.languages.cplusplus.cmake.package.version} + ''; +} diff --git a/tests/cplusplus-conan-llvm-devenv/devenv.yaml b/tests/cplusplus-conan-llvm-devenv/devenv.yaml new file mode 100644 index 000000000..0a9fd6c94 --- /dev/null +++ b/tests/cplusplus-conan-llvm-devenv/devenv.yaml @@ -0,0 +1,3 @@ +inputs: + conan-flake: + url: git+https://codeberg.org/tarcisio/conan-flake diff --git a/tests/cplusplus-conan-llvm/devenv.nix b/tests/cplusplus-conan-llvm/devenv.nix new file mode 100644 index 000000000..c16a06ad1 --- /dev/null +++ b/tests/cplusplus-conan-llvm/devenv.nix @@ -0,0 +1,29 @@ +{ pkgs, config, ... }: + +{ + 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; + }; + }; + }; + enterTest = '' + ${pkgs.lib.getExe config.languages.cplusplus.package} --version + ${pkgs.lib.getExe config.languages.cplusplus.cmake.package} --version + ${pkgs.lib.getExe config.languages.cplusplus.conan.package} --version + echo "enable:"${pkgs.lib.escapeShellArg config.languages.cplusplus.tools.enable}":" | grep "enable:1:" + ${pkgs.lib.getExe config.languages.cplusplus.conan.package} profile show | grep "cmake/"${pkgs.lib.escapeShellArg config.languages.cplusplus.cmake.package.version} + ''; +} diff --git a/tests/cplusplus-conan-llvm/devenv.yaml b/tests/cplusplus-conan-llvm/devenv.yaml new file mode 100644 index 000000000..0a9fd6c94 --- /dev/null +++ b/tests/cplusplus-conan-llvm/devenv.yaml @@ -0,0 +1,3 @@ +inputs: + conan-flake: + url: git+https://codeberg.org/tarcisio/conan-flake From 2b36151a6c06ec2a7b6ac1437713fecbb4a7c8a1 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 01:08:48 +0000 Subject: [PATCH 21/48] Auto generate missing individual markdowns --- docs/src/languages/cplusplus.md | 64 +++++++++++++++------------------ 1 file changed, 28 insertions(+), 36 deletions(-) diff --git a/docs/src/languages/cplusplus.md b/docs/src/languages/cplusplus.md index 385045c46..842b56dc2 100644 --- a/docs/src/languages/cplusplus.md +++ b/docs/src/languages/cplusplus.md @@ -10,8 +10,9 @@ languages.cplusplus = { ``` This will automatically: + - Use `clang` as the default C++ package -- Install it along with `cmake` and other tools +- Install it along with CMake and other tools Alternatively, you can manually specify packages: @@ -30,30 +31,25 @@ Add `conan-flake` to your inputs: $ devenv inputs add conan-flake git+https://codeberg.org/tarcisio/conan-flake ``` -You can check [the list of available options](/reference/options.md#languagescplusplusenable). 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. +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, the following code would configure Conan to use the same CMake available in the developmemnt shell: +Config the `devenv.nix` file accordingly. For example: ```nix -{ inputs, ... }: - -{ +languages.cplusplus = { + enable = true; conan = { enable = true; - config = { - platformToolRequires = { - cmake = pkgs.cmake.version; - }; - devShell = { - packages = [ - pkgs.cmake - ]; - }; - }; + install.enable = true; }; -} +}; ``` +By default, when the Conan package 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 @@ -71,28 +67,24 @@ conan profile show # This would show the default profile. If you would like to integrate with the LLVM compiler infrastructure: ```nix -{ inputs, pkgs, ... }: +{ pkgs, ... }: { - conan = { + languages.cplusplus = { 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; - platformToolRequires = { - cmake = pkgs.cmake.version; - }; - devShell = { - packages = [ - pkgs.cmake - ]; + 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; }; }; }; From 12aadd46630ad4c00074dcb38640c313ef108f82 Mon Sep 17 00:00:00 2001 From: tarcisio Date: Fri, 22 May 2026 01:15:29 +0000 Subject: [PATCH 22/48] Improve docs and tests --- .../individual-docs/languages/cplusplus.md | 30 ++++++++++++++++++- tests/cplusplus-conan-llvm-devenv/devenv.nix | 1 + 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/docs/src/individual-docs/languages/cplusplus.md b/docs/src/individual-docs/languages/cplusplus.md index ba0f904f2..26a4e44b9 100644 --- a/docs/src/individual-docs/languages/cplusplus.md +++ b/docs/src/individual-docs/languages/cplusplus.md @@ -44,7 +44,7 @@ languages.cplusplus = { }; ``` -By default, when the Conan package is enabled: +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 @@ -90,6 +90,34 @@ If you would like to integrate with the LLVM compiler infrastructure: } ``` +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 diff --git a/tests/cplusplus-conan-llvm-devenv/devenv.nix b/tests/cplusplus-conan-llvm-devenv/devenv.nix index bd7f66f43..d85b6a502 100644 --- a/tests/cplusplus-conan-llvm-devenv/devenv.nix +++ b/tests/cplusplus-conan-llvm-devenv/devenv.nix @@ -20,6 +20,7 @@ }; }; }; + enterTest = '' ${pkgs.lib.getExe config.languages.cplusplus.package} --version ${pkgs.lib.getExe config.languages.cplusplus.cmake.package} --version From 32ca00abffb1db8730a5d131f456e8d87bef18fa Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 01:19:38 +0000 Subject: [PATCH 23/48] Auto generate missing individual markdowns --- docs/src/languages/cplusplus.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/docs/src/languages/cplusplus.md b/docs/src/languages/cplusplus.md index 842b56dc2..03aa8c2e5 100644 --- a/docs/src/languages/cplusplus.md +++ b/docs/src/languages/cplusplus.md @@ -45,7 +45,7 @@ languages.cplusplus = { }; ``` -By default, when the Conan package is enabled: +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 @@ -91,6 +91,34 @@ If you would like to integrate with the LLVM compiler infrastructure: } ``` +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 From a6dbeb052fa9a653a0fddbf79d4cf4ec8798ca9a Mon Sep 17 00:00:00 2001 From: tarcisio Date: Fri, 22 May 2026 11:48:01 +0000 Subject: [PATCH 24/48] Improve tests --- tests/cplusplus-conan-llvm-devenv/devenv.nix | 7 ++++++- tests/cplusplus-conan-llvm/devenv.nix | 7 ++++++- tests/cplusplus-conan/devenv.nix | 10 ++++++++-- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/tests/cplusplus-conan-llvm-devenv/devenv.nix b/tests/cplusplus-conan-llvm-devenv/devenv.nix index d85b6a502..5e8913cb1 100644 --- a/tests/cplusplus-conan-llvm-devenv/devenv.nix +++ b/tests/cplusplus-conan-llvm-devenv/devenv.nix @@ -23,9 +23,14 @@ enterTest = '' ${pkgs.lib.getExe config.languages.cplusplus.package} --version + ${pkgs.lib.getExe config.languages.cplusplus.package} --version \ + | grep clang ${pkgs.lib.getExe config.languages.cplusplus.cmake.package} --version + ${pkgs.lib.getExe config.languages.cplusplus.lsp.package} --version \ + | grep ${pkgs.lib.escapeShellArg config.languages.cplusplus.lsp.package.version} ${pkgs.lib.getExe config.languages.cplusplus.conan.package} --version echo "enable:"${pkgs.lib.escapeShellArg config.languages.cplusplus.tools.enable}":" | grep "enable:1:" - ${pkgs.lib.getExe config.languages.cplusplus.conan.package} profile show | grep "cmake/"${pkgs.lib.escapeShellArg config.languages.cplusplus.cmake.package.version} + ${pkgs.lib.getExe config.languages.cplusplus.conan.package} profile show \ + | grep "cmake/"${pkgs.lib.escapeShellArg config.languages.cplusplus.cmake.package.version} ''; } diff --git a/tests/cplusplus-conan-llvm/devenv.nix b/tests/cplusplus-conan-llvm/devenv.nix index c16a06ad1..596cf8484 100644 --- a/tests/cplusplus-conan-llvm/devenv.nix +++ b/tests/cplusplus-conan-llvm/devenv.nix @@ -21,9 +21,14 @@ }; enterTest = '' ${pkgs.lib.getExe config.languages.cplusplus.package} --version + ${pkgs.lib.getExe config.languages.cplusplus.package} --version \ + | grep clang ${pkgs.lib.getExe config.languages.cplusplus.cmake.package} --version + ${pkgs.lib.getExe config.languages.cplusplus.lsp.package} --version \ + | grep ${pkgs.lib.escapeShellArg config.languages.cplusplus.lsp.package.version} ${pkgs.lib.getExe config.languages.cplusplus.conan.package} --version echo "enable:"${pkgs.lib.escapeShellArg config.languages.cplusplus.tools.enable}":" | grep "enable:1:" - ${pkgs.lib.getExe config.languages.cplusplus.conan.package} profile show | grep "cmake/"${pkgs.lib.escapeShellArg config.languages.cplusplus.cmake.package.version} + ${pkgs.lib.getExe config.languages.cplusplus.conan.package} profile show \ + | grep "cmake/"${pkgs.lib.escapeShellArg config.languages.cplusplus.cmake.package.version} ''; } diff --git a/tests/cplusplus-conan/devenv.nix b/tests/cplusplus-conan/devenv.nix index e0290874d..04c17f6a2 100644 --- a/tests/cplusplus-conan/devenv.nix +++ b/tests/cplusplus-conan/devenv.nix @@ -6,9 +6,15 @@ languages.cplusplus.conan.install.enable = true; enterTest = '' ${pkgs.lib.getExe config.languages.cplusplus.package} --version + ${pkgs.lib.getExe config.languages.cplusplus.package} --version \ + | grep ${pkgs.lib.escapeShellArg config.stdenv.cc.cc.pname} ${pkgs.lib.getExe config.languages.cplusplus.cmake.package} --version + ${pkgs.lib.getExe config.languages.cplusplus.lsp.package} --version \ + | grep ${pkgs.lib.escapeShellArg config.languages.cplusplus.lsp.package.version} ${pkgs.lib.getExe config.languages.cplusplus.conan.package} --version - echo "enable:"${pkgs.lib.escapeShellArg config.languages.cplusplus.tools.enable}":" | grep "enable:"${pkgs.lib.escapeShellArg config.stdenv.cc.isClang}":" - ${pkgs.lib.getExe config.languages.cplusplus.conan.package} profile show | grep "cmake/"${pkgs.lib.escapeShellArg config.languages.cplusplus.cmake.package.version} + echo "enable:"${pkgs.lib.escapeShellArg config.languages.cplusplus.tools.enable}":" \ + | grep "enable:"${pkgs.lib.escapeShellArg config.stdenv.cc.isClang}":" + ${pkgs.lib.getExe config.languages.cplusplus.conan.package} profile show \ + | grep "cmake/"${pkgs.lib.escapeShellArg config.languages.cplusplus.cmake.package.version} ''; } From b10a5455b5d07b1b30291dc8f3e8a5971f1f506f Mon Sep 17 00:00:00 2001 From: tarcisio Date: Fri, 22 May 2026 13:26:23 +0000 Subject: [PATCH 25/48] Test clang is default cplusplus compiler by default --- tests/cplusplus/devenv.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/cplusplus/devenv.nix b/tests/cplusplus/devenv.nix index 5be70d463..cd9f2937b 100644 --- a/tests/cplusplus/devenv.nix +++ b/tests/cplusplus/devenv.nix @@ -4,6 +4,8 @@ languages.cplusplus.enable = true; enterTest = '' clang --version + ${pkgs.lib.getExe config.languages.cplusplus.package} --version \ + | grep clang cmake --version ccls --version | grep ${pkgs.lib.escapeShellArg config.languages.cplusplus.lsp.package.version} # Validate some clang-tools are in the path: From 61f94d4ad5d2ab20bbaa2cf39c18643bf9f87ca7 Mon Sep 17 00:00:00 2001 From: tarcisio Date: Fri, 22 May 2026 13:31:56 +0000 Subject: [PATCH 26/48] Fix zig docs (enumeration was broken) --- docs/src/individual-docs/languages/zig.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/src/individual-docs/languages/zig.md b/docs/src/individual-docs/languages/zig.md index b49cbeea7..f3f00ab77 100644 --- a/docs/src/individual-docs/languages/zig.md +++ b/docs/src/individual-docs/languages/zig.md @@ -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) From 255ac6e3ce22414b12048c10f788544bb912b041 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 13:37:08 +0000 Subject: [PATCH 27/48] Auto generate missing individual markdowns --- docs/src/languages/zig.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/src/languages/zig.md b/docs/src/languages/zig.md index d68e0c1e8..72058b04a 100644 --- a/docs/src/languages/zig.md +++ b/docs/src/languages/zig.md @@ -11,6 +11,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) From 94e8bb89dcf45fb9b7f4f7dae335802848077eb1 Mon Sep 17 00:00:00 2001 From: tarcisio Date: Wed, 27 May 2026 17:41:59 +0000 Subject: [PATCH 28/48] Add support to stdenvNoCC --- src/modules/languages/cplusplus.nix | 2 +- tests/cplusplus-conan-stdenvNoCC/devenv.nix | 21 ++++++++++++++++++++ tests/cplusplus-conan-stdenvNoCC/devenv.yaml | 3 +++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 tests/cplusplus-conan-stdenvNoCC/devenv.nix create mode 100644 tests/cplusplus-conan-stdenvNoCC/devenv.yaml diff --git a/src/modules/languages/cplusplus.nix b/src/modules/languages/cplusplus.nix index 6be1f254c..97bc09735 100644 --- a/src/modules/languages/cplusplus.nix +++ b/src/modules/languages/cplusplus.nix @@ -100,7 +100,7 @@ in # (lib.mkIf (cfg.enable && cfg.conan.enable) { - languages.cplusplus.conan.config.stdenv = lib.mkDefault config.stdenv; + languages.cplusplus.conan.config.stdenv = lib.mkDefault (if config.stdenv.hasCC then config.stdenv else pkgs.stdenv); languages.cplusplus.conan.config.package = lib.mkDefault cfg.conan.package; languages.cplusplus.conan.config.platformToolRequires = lib.mkDefault { cmake = cfg.cmake.package.version; diff --git a/tests/cplusplus-conan-stdenvNoCC/devenv.nix b/tests/cplusplus-conan-stdenvNoCC/devenv.nix new file mode 100644 index 000000000..64e90ee5d --- /dev/null +++ b/tests/cplusplus-conan-stdenvNoCC/devenv.nix @@ -0,0 +1,21 @@ +{ pkgs, config, ... }: + +{ + stdenv = pkgs.stdenvNoCC; + languages.cplusplus.enable = true; + languages.cplusplus.conan.enable = true; + languages.cplusplus.conan.install.enable = true; + enterTest = '' + ${pkgs.lib.getExe config.languages.cplusplus.package} --version + ${pkgs.lib.getExe config.languages.cplusplus.package} --version \ + | grep ${pkgs.lib.escapeShellArg pkgs.stdenv.cc.cc.pname} + ${pkgs.lib.getExe config.languages.cplusplus.cmake.package} --version + ${pkgs.lib.getExe config.languages.cplusplus.lsp.package} --version \ + | grep ${pkgs.lib.escapeShellArg config.languages.cplusplus.lsp.package.version} + ${pkgs.lib.getExe config.languages.cplusplus.conan.package} --version + echo "enable:"${pkgs.lib.escapeShellArg config.languages.cplusplus.tools.enable}":" \ + | grep "enable:"${pkgs.lib.escapeShellArg pkgs.stdenv.cc.isClang}":" + ${pkgs.lib.getExe config.languages.cplusplus.conan.package} profile show \ + | grep "cmake/"${pkgs.lib.escapeShellArg config.languages.cplusplus.cmake.package.version} + ''; +} diff --git a/tests/cplusplus-conan-stdenvNoCC/devenv.yaml b/tests/cplusplus-conan-stdenvNoCC/devenv.yaml new file mode 100644 index 000000000..0a9fd6c94 --- /dev/null +++ b/tests/cplusplus-conan-stdenvNoCC/devenv.yaml @@ -0,0 +1,3 @@ +inputs: + conan-flake: + url: git+https://codeberg.org/tarcisio/conan-flake From 791d008e3e0b37037d0e7bf154f5026d6731fb9b Mon Sep 17 00:00:00 2001 From: tarcisio Date: Fri, 29 May 2026 01:21:23 +0000 Subject: [PATCH 29/48] Test the commands are in path (do not call getExe directly on packages) --- src/modules/languages/cplusplus.nix | 4 +++- tests/cplusplus-conan-llvm-devenv/devenv.nix | 16 +++++++++------- tests/cplusplus-conan-llvm/devenv.nix | 16 +++++++++------- tests/cplusplus-conan-stdenvNoCC/devenv.nix | 16 +++++++++------- tests/cplusplus-conan/devenv.nix | 16 +++++++++------- tests/cplusplus/devenv.nix | 6 ++++-- 6 files changed, 43 insertions(+), 31 deletions(-) diff --git a/src/modules/languages/cplusplus.nix b/src/modules/languages/cplusplus.nix index 97bc09735..09e7ff1ac 100644 --- a/src/modules/languages/cplusplus.nix +++ b/src/modules/languages/cplusplus.nix @@ -95,7 +95,8 @@ in cfg.package ] ++ lib.optional cfg.tools.enable cfg.tools.package - ++ lib.optional cfg.lsp.enable cfg.lsp.package; + ++ lib.optional cfg.lsp.enable cfg.lsp.package + ++ lib.optional cfg.conan.enable cfg.conan.package; }) # @@ -105,6 +106,7 @@ in languages.cplusplus.conan.config.platformToolRequires = lib.mkDefault { cmake = cfg.cmake.package.version; }; + languages.cplusplus.conan.config.defaults.enable = lib.mkDefault false; languages.cplusplus.package = lib.mkDefault cfg.conan.config.stdenv.cc; }) diff --git a/tests/cplusplus-conan-llvm-devenv/devenv.nix b/tests/cplusplus-conan-llvm-devenv/devenv.nix index 5e8913cb1..a29fc46a6 100644 --- a/tests/cplusplus-conan-llvm-devenv/devenv.nix +++ b/tests/cplusplus-conan-llvm-devenv/devenv.nix @@ -1,5 +1,7 @@ { pkgs, config, ... }: - +let + getCommand = package: builtins.baseNameOf (pkgs.lib.getExe package); +in { stdenv = pkgs.overrideCC ( @@ -22,15 +24,15 @@ }; enterTest = '' - ${pkgs.lib.getExe config.languages.cplusplus.package} --version - ${pkgs.lib.getExe config.languages.cplusplus.package} --version \ + ${getCommand config.languages.cplusplus.package} --version + ${getCommand config.languages.cplusplus.package} --version \ | grep clang - ${pkgs.lib.getExe config.languages.cplusplus.cmake.package} --version - ${pkgs.lib.getExe config.languages.cplusplus.lsp.package} --version \ + ${getCommand config.languages.cplusplus.cmake.package} --version + ${getCommand config.languages.cplusplus.lsp.package} --version \ | grep ${pkgs.lib.escapeShellArg config.languages.cplusplus.lsp.package.version} - ${pkgs.lib.getExe config.languages.cplusplus.conan.package} --version + ${getCommand config.languages.cplusplus.conan.package} --version echo "enable:"${pkgs.lib.escapeShellArg config.languages.cplusplus.tools.enable}":" | grep "enable:1:" - ${pkgs.lib.getExe config.languages.cplusplus.conan.package} profile show \ + ${getCommand config.languages.cplusplus.conan.package} profile show \ | grep "cmake/"${pkgs.lib.escapeShellArg config.languages.cplusplus.cmake.package.version} ''; } diff --git a/tests/cplusplus-conan-llvm/devenv.nix b/tests/cplusplus-conan-llvm/devenv.nix index 596cf8484..f895b7fa8 100644 --- a/tests/cplusplus-conan-llvm/devenv.nix +++ b/tests/cplusplus-conan-llvm/devenv.nix @@ -1,5 +1,7 @@ { pkgs, config, ... }: - +let + getCommand = package: builtins.baseNameOf (pkgs.lib.getExe package); +in { languages.cplusplus = { enable = true; @@ -20,15 +22,15 @@ }; }; enterTest = '' - ${pkgs.lib.getExe config.languages.cplusplus.package} --version - ${pkgs.lib.getExe config.languages.cplusplus.package} --version \ + ${getCommand config.languages.cplusplus.package} --version + ${getCommand config.languages.cplusplus.package} --version \ | grep clang - ${pkgs.lib.getExe config.languages.cplusplus.cmake.package} --version - ${pkgs.lib.getExe config.languages.cplusplus.lsp.package} --version \ + ${getCommand config.languages.cplusplus.cmake.package} --version + ${getCommand config.languages.cplusplus.lsp.package} --version \ | grep ${pkgs.lib.escapeShellArg config.languages.cplusplus.lsp.package.version} - ${pkgs.lib.getExe config.languages.cplusplus.conan.package} --version + ${getCommand config.languages.cplusplus.conan.package} --version echo "enable:"${pkgs.lib.escapeShellArg config.languages.cplusplus.tools.enable}":" | grep "enable:1:" - ${pkgs.lib.getExe config.languages.cplusplus.conan.package} profile show \ + ${getCommand config.languages.cplusplus.conan.package} profile show \ | grep "cmake/"${pkgs.lib.escapeShellArg config.languages.cplusplus.cmake.package.version} ''; } diff --git a/tests/cplusplus-conan-stdenvNoCC/devenv.nix b/tests/cplusplus-conan-stdenvNoCC/devenv.nix index 64e90ee5d..b21844c90 100644 --- a/tests/cplusplus-conan-stdenvNoCC/devenv.nix +++ b/tests/cplusplus-conan-stdenvNoCC/devenv.nix @@ -1,21 +1,23 @@ { pkgs, config, ... }: - +let + getCommand = package: builtins.baseNameOf (pkgs.lib.getExe package); +in { stdenv = pkgs.stdenvNoCC; languages.cplusplus.enable = true; languages.cplusplus.conan.enable = true; languages.cplusplus.conan.install.enable = true; enterTest = '' - ${pkgs.lib.getExe config.languages.cplusplus.package} --version - ${pkgs.lib.getExe config.languages.cplusplus.package} --version \ + ${getCommand config.languages.cplusplus.package} --version + ${getCommand config.languages.cplusplus.package} --version \ | grep ${pkgs.lib.escapeShellArg pkgs.stdenv.cc.cc.pname} - ${pkgs.lib.getExe config.languages.cplusplus.cmake.package} --version - ${pkgs.lib.getExe config.languages.cplusplus.lsp.package} --version \ + ${getCommand config.languages.cplusplus.cmake.package} --version + ${getCommand config.languages.cplusplus.lsp.package} --version \ | grep ${pkgs.lib.escapeShellArg config.languages.cplusplus.lsp.package.version} - ${pkgs.lib.getExe config.languages.cplusplus.conan.package} --version + ${getCommand config.languages.cplusplus.conan.package} --version echo "enable:"${pkgs.lib.escapeShellArg config.languages.cplusplus.tools.enable}":" \ | grep "enable:"${pkgs.lib.escapeShellArg pkgs.stdenv.cc.isClang}":" - ${pkgs.lib.getExe config.languages.cplusplus.conan.package} profile show \ + ${getCommand config.languages.cplusplus.conan.package} profile show \ | grep "cmake/"${pkgs.lib.escapeShellArg config.languages.cplusplus.cmake.package.version} ''; } diff --git a/tests/cplusplus-conan/devenv.nix b/tests/cplusplus-conan/devenv.nix index 04c17f6a2..5eb524505 100644 --- a/tests/cplusplus-conan/devenv.nix +++ b/tests/cplusplus-conan/devenv.nix @@ -1,20 +1,22 @@ { pkgs, config, ... }: - +let + getCommand = package: builtins.baseNameOf (pkgs.lib.getExe package); +in { languages.cplusplus.enable = true; languages.cplusplus.conan.enable = true; languages.cplusplus.conan.install.enable = true; enterTest = '' - ${pkgs.lib.getExe config.languages.cplusplus.package} --version - ${pkgs.lib.getExe config.languages.cplusplus.package} --version \ + ${getCommand config.languages.cplusplus.package} --version + ${getCommand config.languages.cplusplus.package} --version \ | grep ${pkgs.lib.escapeShellArg config.stdenv.cc.cc.pname} - ${pkgs.lib.getExe config.languages.cplusplus.cmake.package} --version - ${pkgs.lib.getExe config.languages.cplusplus.lsp.package} --version \ + ${getCommand config.languages.cplusplus.cmake.package} --version + ${getCommand config.languages.cplusplus.lsp.package} --version \ | grep ${pkgs.lib.escapeShellArg config.languages.cplusplus.lsp.package.version} - ${pkgs.lib.getExe config.languages.cplusplus.conan.package} --version + ${getCommand config.languages.cplusplus.conan.package} --version echo "enable:"${pkgs.lib.escapeShellArg config.languages.cplusplus.tools.enable}":" \ | grep "enable:"${pkgs.lib.escapeShellArg config.stdenv.cc.isClang}":" - ${pkgs.lib.getExe config.languages.cplusplus.conan.package} profile show \ + ${getCommand config.languages.cplusplus.conan.package} profile show \ | grep "cmake/"${pkgs.lib.escapeShellArg config.languages.cplusplus.cmake.package.version} ''; } diff --git a/tests/cplusplus/devenv.nix b/tests/cplusplus/devenv.nix index cd9f2937b..d52339055 100644 --- a/tests/cplusplus/devenv.nix +++ b/tests/cplusplus/devenv.nix @@ -1,10 +1,12 @@ { pkgs, config, ... }: - +let + getCommand = package: builtins.baseNameOf (pkgs.lib.getExe package); +in { languages.cplusplus.enable = true; enterTest = '' clang --version - ${pkgs.lib.getExe config.languages.cplusplus.package} --version \ + ${getCommand config.languages.cplusplus.package} --version \ | grep clang cmake --version ccls --version | grep ${pkgs.lib.escapeShellArg config.languages.cplusplus.lsp.package.version} From be32dc866d1b16033b6f6de85aec8039995d2046 Mon Sep 17 00:00:00 2001 From: tarcisio Date: Mon, 1 Jun 2026 01:34:18 +0000 Subject: [PATCH 30/48] Improve docs and test local-recipe-index --- .../individual-docs/languages/cplusplus.md | 98 +++++++++++++- tests/cplusplus-conan-recipe/CMakeLists.txt | 15 +++ tests/cplusplus-conan-recipe/conanfile.py | 42 ++++++ tests/cplusplus-conan-recipe/devenv.nix | 31 +++++ tests/cplusplus-conan-recipe/devenv.yaml | 3 + .../recipes/hello-world/all/CMakeLists.txt | 9 ++ .../repo/recipes/hello-world/all/conanfile.py | 53 ++++++++ .../hello-world/all/include/hello-world.h | 14 ++ .../hello-world/all/src/hello-world.cpp | 120 ++++++++++++++++++ .../all/test_package/CMakeLists.txt | 7 + .../hello-world/all/test_package/conanfile.py | 26 ++++ .../all/test_package/src/example.cpp | 12 ++ .../repo/recipes/hello-world/config.yml | 3 + tests/cplusplus-conan-recipe/src/example.cpp | 10 ++ tests/cplusplus-conan-recipe/src/example.h | 12 ++ tests/cplusplus-conan-recipe/src/main.cpp | 15 +++ .../test_package/.gitignore | 3 + .../test_package/conanfile.py | 15 +++ 18 files changed, 483 insertions(+), 5 deletions(-) create mode 100644 tests/cplusplus-conan-recipe/CMakeLists.txt create mode 100644 tests/cplusplus-conan-recipe/conanfile.py create mode 100644 tests/cplusplus-conan-recipe/devenv.nix create mode 100644 tests/cplusplus-conan-recipe/devenv.yaml create mode 100644 tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/CMakeLists.txt create mode 100644 tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/conanfile.py create mode 100644 tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/include/hello-world.h create mode 100644 tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/src/hello-world.cpp create mode 100644 tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/test_package/CMakeLists.txt create mode 100644 tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/test_package/conanfile.py create mode 100644 tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/test_package/src/example.cpp create mode 100644 tests/cplusplus-conan-recipe/repo/recipes/hello-world/config.yml create mode 100644 tests/cplusplus-conan-recipe/src/example.cpp create mode 100644 tests/cplusplus-conan-recipe/src/example.h create mode 100644 tests/cplusplus-conan-recipe/src/main.cpp create mode 100644 tests/cplusplus-conan-recipe/test_package/.gitignore create mode 100644 tests/cplusplus-conan-recipe/test_package/conanfile.py diff --git a/docs/src/individual-docs/languages/cplusplus.md b/docs/src/individual-docs/languages/cplusplus.md index 26a4e44b9..d6c25fe11 100644 --- a/docs/src/individual-docs/languages/cplusplus.md +++ b/docs/src/individual-docs/languages/cplusplus.md @@ -24,13 +24,44 @@ languages.cplusplus = { ## Setting up the [Conan](https://conan.io/) package manager -Add `conan-flake` to your inputs: +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. +The conan-flake module bridges the gap between Nix and Conan, supporting a declarative configuration style. For instance, for a user profile configuration like the following: + +```ini +[settings] +build_type=Debug +compiler.cppstd + +[platform_tool_requires] +cmake/X.Y.Z +``` + +There correspond the following conan-flake options: + +```nix +{ + buildType = "Debug"; + compilerCppStd = "14"; + + platformToolRequires = { + cmake = pkgs.cmake.version; + }; + + devShell = { + # Programs you want to make available in the shell. + tools = { + inherit (pkgs) cmake; + }; + }; +} +``` + +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: @@ -40,6 +71,10 @@ languages.cplusplus = { conan = { enable = true; install.enable = true; + config = { + buildType = "Debug"; + compilerCppStd = "14"; + }; }; }; ``` @@ -47,7 +82,7 @@ languages.cplusplus = { 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 +- Conan is configured to use the same CMake available in the developmemnt shell; it's not necessary to set the `languages.cplusplus.conan.config.platformToolRequires.cmake` and `languages.cplusplus.conan.config.devShell.tools.cmake` options explicitly ### In Action: @@ -56,7 +91,7 @@ $ devenv shell Building shell ... Entering shell ... -conan profile show # This would show the default profile. +conan profile show # This would show the configured profile. ``` ## Additional Examples @@ -118,6 +153,58 @@ Or even: } ``` +In this second use case: + +- By default, conan-flake is configured using the same stdenv as devenv's (that is, `config.stdenv`) + +### In Action: + +```shell-session +$ devenv shell +Building shell ... +Entering shell ... + +conan profile show # This would show the configured profile. +conan create . --build=missing # This would create and test the current package. +``` + +### A local-recipe-index remote + +With [local-recipe-index](https://docs.conan.io/2/tutorial/conan_repositories/setup_local_recipes_index.html) remotes it's possible to declare dependencies from a simplified local index structure: + +```nix +{ + languages.cplusplus = { + enable = true; + + conan = { + enable = true; + install.enable = true; + + config = { + buildType = "Release"; + compilerCppStd = "17"; + + remotes.local = { + url = "./repo"; + local = true; + allowedPackages = [ + "hello-world/0.0.1.cci.20260428" + ]; + }; + + offline = true; + }; + }; + }; +} +``` + +The options in the `languages.cplusplus.conan.config` namespace: + +- `remotes.local.url`: is taken as a relative path to the root of the configuration +- `offline`: enable only local remotes (that is, only of local-recipe-index type) + ### In Action: ```shell-session @@ -125,7 +212,8 @@ $ devenv shell Building shell ... Entering shell ... -conan profile show # This would show the default profile. +conan profile show # This would show the configured profile. +conan remote list # This would list the configured remotes. conan create . --build=missing # This would create and test the current package. ``` diff --git a/tests/cplusplus-conan-recipe/CMakeLists.txt b/tests/cplusplus-conan-recipe/CMakeLists.txt new file mode 100644 index 000000000..c4669de5c --- /dev/null +++ b/tests/cplusplus-conan-recipe/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.15) +project(example CXX) + +find_package(hello-world CONFIG REQUIRED) + +add_executable(example src/example.cpp src/main.cpp) + +target_link_libraries(example hello-world::hello-world) + +install( + TARGETS example + DESTINATION "." + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib) diff --git a/tests/cplusplus-conan-recipe/conanfile.py b/tests/cplusplus-conan-recipe/conanfile.py new file mode 100644 index 000000000..e9a57d7ee --- /dev/null +++ b/tests/cplusplus-conan-recipe/conanfile.py @@ -0,0 +1,42 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout + + +class exampleRecipe(ConanFile): + name = "example" + version = "0.0.1" + package_type = "application" + + # Optional metadata + license = "MIT" + author = "Tarcisio G. Rodrigues" + homepage = "https://codeberg.org/tarcisio/conan-flake" + description = "This is the Example project." + topics = ("testing", "example", "conan") + + # Binary configuration + settings = "os", "compiler", "build_type", "arch" + + # Sources are located in the same place as this recipe, copy them to the recipe + exports_sources = "CMakeLists.txt", "src/*" + + def layout(self): + cmake_layout(self) + + def requirements(self): + self.requires("hello-world/0.0.1.cci.20260428") + + def generate(self): + deps = CMakeDeps(self) + deps.generate() + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() diff --git a/tests/cplusplus-conan-recipe/devenv.nix b/tests/cplusplus-conan-recipe/devenv.nix new file mode 100644 index 000000000..ae823102d --- /dev/null +++ b/tests/cplusplus-conan-recipe/devenv.nix @@ -0,0 +1,31 @@ +{ pkgs, config, ... }: +let + getCommand = package: builtins.baseNameOf (pkgs.lib.getExe package); +in +{ + languages.cplusplus = { + enable = true; + conan = { + enable = true; + install.enable = true; + config = { + buildType = "Release"; + compilerCppStd = "17"; + remotes.local = { + url = "./repo"; + local = true; + allowedPackages = [ + "hello-world/0.0.1.cci.20260428" + ]; + }; + offline = true; + }; + }; + }; + enterTest = '' + ${getCommand config.languages.cplusplus.conan.package} create . --build=missing 2>&1 \ + | grep "example/0.0.1" + ${getCommand config.languages.cplusplus.conan.package} remote list \ + | grep "local-recipes-index, Enabled: True, Allowed packages: hello-world/0.0.1.cci.20260428" + ''; +} diff --git a/tests/cplusplus-conan-recipe/devenv.yaml b/tests/cplusplus-conan-recipe/devenv.yaml new file mode 100644 index 000000000..0a9fd6c94 --- /dev/null +++ b/tests/cplusplus-conan-recipe/devenv.yaml @@ -0,0 +1,3 @@ +inputs: + conan-flake: + url: git+https://codeberg.org/tarcisio/conan-flake diff --git a/tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/CMakeLists.txt b/tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/CMakeLists.txt new file mode 100644 index 000000000..a17fd8bc1 --- /dev/null +++ b/tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.15) + +project(hello-world LANGUAGES CXX) + +add_library(hello-world src/hello-world.cpp) + +target_include_directories(hello-world PUBLIC include) +set_target_properties(hello-world PROPERTIES PUBLIC_HEADER "include/hello-world.h") +install(TARGETS hello-world) diff --git a/tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/conanfile.py b/tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/conanfile.py new file mode 100644 index 000000000..cef4f1220 --- /dev/null +++ b/tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/conanfile.py @@ -0,0 +1,53 @@ +from pathlib import Path + +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout +from conan.tools.files import save + +required_conan_version = ">=2.12" + + +class hello_worldRecipe(ConanFile): + name = "hello-world" + package_type = "library" + + # Optional metadata + license = "MIT" + url = "https://github.com/conan-io/conan-center-index" + description = "Dummy recipe for internal testing" + topics = ("conan-testing", "dummy") + + # Binary configuration + settings = "os", "compiler", "build_type", "arch" + options = {"shared": [True, False], "fPIC": [True, False]} + default_options = {"shared": False, "fPIC": True} + + # Sources are located in the same place as this recipe, copy them to the recipe + exports_sources = "CMakeLists.txt", "src/*", "include/*" + + implements = ["auto_shared_fpic"] + + def layout(self): + cmake_layout(self) + + def generate(self): + deps = CMakeDeps(self) + deps.generate() + tc = CMakeToolchain(self) + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def package(self): + cmake = CMake(self) + cmake.install() + + # save a dummy .la file to trigger hook warning + la_file = Path(self.package_folder) / "lib" / "hello-world-foobar.la" + save(self, la_file.as_posix(), "foobar") + + def package_info(self): + self.cpp_info.libs = ["hello-world"] diff --git a/tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/include/hello-world.h b/tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/include/hello-world.h new file mode 100644 index 000000000..23d083c87 --- /dev/null +++ b/tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/include/hello-world.h @@ -0,0 +1,14 @@ +#pragma once + +#include +#include + + +#ifdef _WIN32 + #define HELLO_WORLD_EXPORT __declspec(dllexport) +#else + #define HELLO_WORLD_EXPORT +#endif + +HELLO_WORLD_EXPORT void hello_world(); +HELLO_WORLD_EXPORT void hello_world_print_vector(const std::vector &strings); diff --git a/tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/src/hello-world.cpp b/tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/src/hello-world.cpp new file mode 100644 index 000000000..50f9f4ac1 --- /dev/null +++ b/tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/src/hello-world.cpp @@ -0,0 +1,120 @@ +#include +#include "hello-world.h" + + + +void hello_world(){ + + + #ifdef NDEBUG + std::cout << "hello-world: Hello World Release!\n"; + #else + std::cout << "hello-world: Hello World Debug!\n"; + #endif + + // ARCHITECTURES + #ifdef _M_X64 + std::cout << " hello-world: _M_X64 defined\n"; + #endif + + #ifdef _M_IX86 + std::cout << " hello-world: _M_IX86 defined\n"; + #endif + + #ifdef _M_ARM64 + std::cout << " hello-world: _M_ARM64 defined\n"; + #endif + + #if __i386__ + std::cout << " hello-world: __i386__ defined\n"; + #endif + + #if __x86_64__ + std::cout << " hello-world: __x86_64__ defined\n"; + #endif + + #if __aarch64__ + std::cout << " hello-world: __aarch64__ defined\n"; + #endif + + // Libstdc++ + #if defined _GLIBCXX_USE_CXX11_ABI + std::cout << " hello-world: _GLIBCXX_USE_CXX11_ABI "<< _GLIBCXX_USE_CXX11_ABI << "\n"; + #endif + + // MSVC runtime + #if defined(_DEBUG) + #if defined(_MT) && defined(_DLL) + std::cout << " hello-world: MSVC runtime: MultiThreadedDebugDLL\n"; + #elif defined(_MT) + std::cout << " hello-world: MSVC runtime: MultiThreadedDebug\n"; + #endif + #else + #if defined(_MT) && defined(_DLL) + std::cout << " hello-world: MSVC runtime: MultiThreadedDLL\n"; + #elif defined(_MT) + std::cout << " hello-world: MSVC runtime: MultiThreaded\n"; + #endif + #endif + + // COMPILER VERSIONS + #if _MSC_VER + std::cout << " hello-world: _MSC_VER" << _MSC_VER<< "\n"; + #endif + + #if _MSVC_LANG + std::cout << " hello-world: _MSVC_LANG" << _MSVC_LANG<< "\n"; + #endif + + #if __cplusplus + std::cout << " hello-world: __cplusplus" << __cplusplus<< "\n"; + #endif + + #if __INTEL_COMPILER + std::cout << " hello-world: __INTEL_COMPILER" << __INTEL_COMPILER<< "\n"; + #endif + + #if __GNUC__ + std::cout << " hello-world: __GNUC__" << __GNUC__<< "\n"; + #endif + + #if __GNUC_MINOR__ + std::cout << " hello-world: __GNUC_MINOR__" << __GNUC_MINOR__<< "\n"; + #endif + + #if __clang_major__ + std::cout << " hello-world: __clang_major__" << __clang_major__<< "\n"; + #endif + + #if __clang_minor__ + std::cout << " hello-world: __clang_minor__" << __clang_minor__<< "\n"; + #endif + + #if __apple_build_version__ + std::cout << " hello-world: __apple_build_version__" << __apple_build_version__<< "\n"; + #endif + + // SUBSYSTEMS + + #if __MSYS__ + std::cout << " hello-world: __MSYS__" << __MSYS__<< "\n"; + #endif + + #if __MINGW32__ + std::cout << " hello-world: __MINGW32__" << __MINGW32__<< "\n"; + #endif + + #if __MINGW64__ + std::cout << " hello-world: __MINGW64__" << __MINGW64__<< "\n"; + #endif + + #if __CYGWIN__ + std::cout << " hello-world: __CYGWIN__" << __CYGWIN__<< "\n"; + #endif +} + +void hello_world_print_vector(const std::vector &strings) { + for(std::vector::const_iterator it = strings.begin(); it != strings.end(); ++it) { + std::cout << "hello_world " << *it << std::endl; + } +} diff --git a/tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/test_package/CMakeLists.txt b/tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/test_package/CMakeLists.txt new file mode 100644 index 000000000..ad9491538 --- /dev/null +++ b/tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/test_package/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.15) +project(PackageTest CXX) + +find_package(hello-world CONFIG REQUIRED) + +add_executable(example src/example.cpp) +target_link_libraries(example hello-world::hello-world) diff --git a/tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/test_package/conanfile.py b/tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/test_package/conanfile.py new file mode 100644 index 000000000..4a96772e5 --- /dev/null +++ b/tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/test_package/conanfile.py @@ -0,0 +1,26 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import CMake, cmake_layout + + +class hello_worldTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "CMakeDeps", "CMakeToolchain" + + def requirements(self): + self.requires(self.tested_reference_str) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def layout(self): + cmake_layout(self) + + def test(self): + if can_run(self): + cmd = os.path.join(self.cpp.build.bindir, "example") + self.run(cmd, env="conanrun") diff --git a/tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/test_package/src/example.cpp b/tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/test_package/src/example.cpp new file mode 100644 index 000000000..7eaed2893 --- /dev/null +++ b/tests/cplusplus-conan-recipe/repo/recipes/hello-world/all/test_package/src/example.cpp @@ -0,0 +1,12 @@ +#include "hello-world.h" +#include +#include + +int main() { + hello_world(); + + std::vector vec; + vec.push_back("test_package"); + + hello_world_print_vector(vec); +} diff --git a/tests/cplusplus-conan-recipe/repo/recipes/hello-world/config.yml b/tests/cplusplus-conan-recipe/repo/recipes/hello-world/config.yml new file mode 100644 index 000000000..11d0bf94a --- /dev/null +++ b/tests/cplusplus-conan-recipe/repo/recipes/hello-world/config.yml @@ -0,0 +1,3 @@ +versions: + "0.0.1.cci.20260428": + folder: all diff --git a/tests/cplusplus-conan-recipe/src/example.cpp b/tests/cplusplus-conan-recipe/src/example.cpp new file mode 100644 index 000000000..8e6ad2418 --- /dev/null +++ b/tests/cplusplus-conan-recipe/src/example.cpp @@ -0,0 +1,10 @@ +#include + +#include "example.h" + +void example_print_vector(const std::vector &strings) { + for (std::vector::const_iterator it = strings.begin(); + it != strings.end(); ++it) { + std::cout << "example/0.0.1 " << *it << std::endl; + } +} diff --git a/tests/cplusplus-conan-recipe/src/example.h b/tests/cplusplus-conan-recipe/src/example.h new file mode 100644 index 000000000..f08bd5d75 --- /dev/null +++ b/tests/cplusplus-conan-recipe/src/example.h @@ -0,0 +1,12 @@ +#pragma once + +#include +#include + +#ifdef _WIN32 +#define EXAMPLE_EXPORT __declspec(dllexport) +#else +#define EXAMPLE_EXPORT +#endif + +EXAMPLE_EXPORT void example_print_vector(const std::vector &strings); diff --git a/tests/cplusplus-conan-recipe/src/main.cpp b/tests/cplusplus-conan-recipe/src/main.cpp new file mode 100644 index 000000000..2ea64b33a --- /dev/null +++ b/tests/cplusplus-conan-recipe/src/main.cpp @@ -0,0 +1,15 @@ +#include +#include + +#include "example.h" +#include "hello-world.h" + + +int main() { + hello_world(); + + std::vector vec; + vec.push_back("test_package"); + + example_print_vector(vec); +} diff --git a/tests/cplusplus-conan-recipe/test_package/.gitignore b/tests/cplusplus-conan-recipe/test_package/.gitignore new file mode 100644 index 000000000..cdb5a221d --- /dev/null +++ b/tests/cplusplus-conan-recipe/test_package/.gitignore @@ -0,0 +1,3 @@ +* +!.gitignore +!conanfile.py diff --git a/tests/cplusplus-conan-recipe/test_package/conanfile.py b/tests/cplusplus-conan-recipe/test_package/conanfile.py new file mode 100644 index 000000000..4b64c0da0 --- /dev/null +++ b/tests/cplusplus-conan-recipe/test_package/conanfile.py @@ -0,0 +1,15 @@ +import os + +from conan import ConanFile +from conan.tools.build import can_run + + +class exampleTestConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + + def requirements(self): + self.requires(self.tested_reference_str) + + def test(self): + if can_run(self): + self.run("example", env="conanrun") From 4eaf4914313c7096e51c0414541e9093659436ad Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 1 Jun 2026 01:38:59 +0000 Subject: [PATCH 31/48] Auto generate missing individual markdowns --- docs/src/languages/cplusplus.md | 98 +++++++++++++++++++++++++++++++-- 1 file changed, 93 insertions(+), 5 deletions(-) diff --git a/docs/src/languages/cplusplus.md b/docs/src/languages/cplusplus.md index 03aa8c2e5..54f375d72 100644 --- a/docs/src/languages/cplusplus.md +++ b/docs/src/languages/cplusplus.md @@ -25,13 +25,44 @@ languages.cplusplus = { ## Setting up the [Conan](https://conan.io/) package manager -Add `conan-flake` to your inputs: +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. +The conan-flake module bridges the gap between Nix and Conan, supporting a declarative configuration style. For instance, for a user profile configuration like the following: + +```ini +[settings] +build_type=Debug +compiler.cppstd + +[platform_tool_requires] +cmake/X.Y.Z +``` + +There correspond the following conan-flake options: + +```nix +{ + buildType = "Debug"; + compilerCppStd = "14"; + + platformToolRequires = { + cmake = pkgs.cmake.version; + }; + + devShell = { + # Programs you want to make available in the shell. + tools = { + inherit (pkgs) cmake; + }; + }; +} +``` + +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: @@ -41,6 +72,10 @@ languages.cplusplus = { conan = { enable = true; install.enable = true; + config = { + buildType = "Debug"; + compilerCppStd = "14"; + }; }; }; ``` @@ -48,7 +83,7 @@ languages.cplusplus = { 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 +- Conan is configured to use the same CMake available in the developmemnt shell; it's not necessary to set the `languages.cplusplus.conan.config.platformToolRequires.cmake` and `languages.cplusplus.conan.config.devShell.tools.cmake` options explicitly ### In Action: @@ -57,7 +92,7 @@ $ devenv shell Building shell ... Entering shell ... -conan profile show # This would show the default profile. +conan profile show # This would show the configured profile. ``` ## Additional Examples @@ -119,6 +154,58 @@ Or even: } ``` +In this second use case: + +- By default, conan-flake is configured using the same stdenv as devenv's (that is, `config.stdenv`) + +### In Action: + +```shell-session +$ devenv shell +Building shell ... +Entering shell ... + +conan profile show # This would show the configured profile. +conan create . --build=missing # This would create and test the current package. +``` + +### A local-recipe-index remote + +With [local-recipe-index](https://docs.conan.io/2/tutorial/conan_repositories/setup_local_recipes_index.html) remotes it's possible to declare dependencies from a simplified local index structure: + +```nix +{ + languages.cplusplus = { + enable = true; + + conan = { + enable = true; + install.enable = true; + + config = { + buildType = "Release"; + compilerCppStd = "17"; + + remotes.local = { + url = "./repo"; + local = true; + allowedPackages = [ + "hello-world/0.0.1.cci.20260428" + ]; + }; + + offline = true; + }; + }; + }; +} +``` + +The options in the `languages.cplusplus.conan.config` namespace: + +- `remotes.local.url`: is taken as a relative path to the root of the configuration +- `offline`: enable only local remotes (that is, only of local-recipe-index type) + ### In Action: ```shell-session @@ -126,7 +213,8 @@ $ devenv shell Building shell ... Entering shell ... -conan profile show # This would show the default profile. +conan profile show # This would show the configured profile. +conan remote list # This would list the configured remotes. conan create . --build=missing # This would create and test the current package. ``` From e998337fdf899c52d6ce722d1c0444f4291c200d Mon Sep 17 00:00:00 2001 From: tarcisio Date: Mon, 1 Jun 2026 01:51:37 +0000 Subject: [PATCH 32/48] Fix docs: compiler.cppstd=14 --- docs/src/individual-docs/languages/cplusplus.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/individual-docs/languages/cplusplus.md b/docs/src/individual-docs/languages/cplusplus.md index d6c25fe11..785dd3172 100644 --- a/docs/src/individual-docs/languages/cplusplus.md +++ b/docs/src/individual-docs/languages/cplusplus.md @@ -35,7 +35,7 @@ The conan-flake module bridges the gap between Nix and Conan, supporting a decla ```ini [settings] build_type=Debug -compiler.cppstd +compiler.cppstd=14 [platform_tool_requires] cmake/X.Y.Z From dd82f8338b5fb85fb77b71d06736ab123b718524 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 1 Jun 2026 01:56:15 +0000 Subject: [PATCH 33/48] Auto generate missing individual markdowns --- docs/src/languages/cplusplus.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/languages/cplusplus.md b/docs/src/languages/cplusplus.md index 54f375d72..55207d2e0 100644 --- a/docs/src/languages/cplusplus.md +++ b/docs/src/languages/cplusplus.md @@ -36,7 +36,7 @@ The conan-flake module bridges the gap between Nix and Conan, supporting a decla ```ini [settings] build_type=Debug -compiler.cppstd +compiler.cppstd=14 [platform_tool_requires] cmake/X.Y.Z From 90dc2c304724f7ac5db0ddecdfb0b0d1c055c956 Mon Sep 17 00:00:00 2001 From: tarcisio Date: Mon, 1 Jun 2026 12:17:03 +0000 Subject: [PATCH 34/48] Revert "Fix zig docs (enumeration was broken)" This reverts commit 61f94d4ad5d2ab20bbaa2cf39c18643bf9f87ca7. --- docs/src/individual-docs/languages/zig.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/src/individual-docs/languages/zig.md b/docs/src/individual-docs/languages/zig.md index f3f00ab77..b49cbeea7 100644 --- a/docs/src/individual-docs/languages/zig.md +++ b/docs/src/individual-docs/languages/zig.md @@ -10,7 +10,6 @@ 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) From a95d5fb4db320c57aa43c47270854b51aa9de033 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 1 Jun 2026 12:21:51 +0000 Subject: [PATCH 35/48] Auto generate missing individual markdowns --- docs/src/languages/zig.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/src/languages/zig.md b/docs/src/languages/zig.md index 72058b04a..d68e0c1e8 100644 --- a/docs/src/languages/zig.md +++ b/docs/src/languages/zig.md @@ -11,7 +11,6 @@ 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) From 7504ac00d46b051ec810ff71350df606d9bbefc6 Mon Sep 17 00:00:00 2001 From: tarcisio Date: Fri, 5 Jun 2026 00:27:41 +0000 Subject: [PATCH 36/48] Fix cpluplux doc --- docs/src/individual-docs/languages/cplusplus.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/individual-docs/languages/cplusplus.md b/docs/src/individual-docs/languages/cplusplus.md index 785dd3172..85e917347 100644 --- a/docs/src/individual-docs/languages/cplusplus.md +++ b/docs/src/individual-docs/languages/cplusplus.md @@ -82,7 +82,7 @@ languages.cplusplus = { 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; it's not necessary to set the `languages.cplusplus.conan.config.platformToolRequires.cmake` and `languages.cplusplus.conan.config.devShell.tools.cmake` options explicitly +- Conan is configured to use the same CMake available in the developmemnt shell; it's not necessary to set the `languages.cplusplus.conan.config.platformToolRequires.cmake` and `languages.cplusplus.conan.config.devShell.tools` options explicitly ### In Action: From 0202f1199508c6789627950e8ab5b6abb9540894 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 5 Jun 2026 00:32:49 +0000 Subject: [PATCH 37/48] Auto generate missing individual markdowns --- docs/src/languages/cplusplus.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/languages/cplusplus.md b/docs/src/languages/cplusplus.md index 55207d2e0..19087a24a 100644 --- a/docs/src/languages/cplusplus.md +++ b/docs/src/languages/cplusplus.md @@ -83,7 +83,7 @@ languages.cplusplus = { 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; it's not necessary to set the `languages.cplusplus.conan.config.platformToolRequires.cmake` and `languages.cplusplus.conan.config.devShell.tools.cmake` options explicitly +- Conan is configured to use the same CMake available in the developmemnt shell; it's not necessary to set the `languages.cplusplus.conan.config.platformToolRequires.cmake` and `languages.cplusplus.conan.config.devShell.tools` options explicitly ### In Action: From 153374cf78da8572edb33d00164af940c2011946 Mon Sep 17 00:00:00 2001 From: tarcisio Date: Fri, 5 Jun 2026 16:24:14 +0000 Subject: [PATCH 38/48] Prefer devenv.root over git.root for configRoot --- src/modules/languages/cplusplus.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/languages/cplusplus.nix b/src/modules/languages/cplusplus.nix index 09e7ff1ac..ac6b722d2 100644 --- a/src/modules/languages/cplusplus.nix +++ b/src/modules/languages/cplusplus.nix @@ -14,8 +14,8 @@ let conan-flake = if cfg.conan.enable then config.lib.getInput inputArgs else config.lib.tryGetInput inputArgs; - # Determine config root: prefer git.root, fallback to devenv.root - configRoot = if config.git.root != null then config.git.root else config.devenv.root; + # Determine config root: prefer devenv.root, fallback to git.root + configRoot = if config.devenv.root != null then config.devenv.root else config.git.root; conanSubmodule = if conan-flake != null then From 5ed84a26d5bbddf5c8f7adf812e0b5e3878b2499 Mon Sep 17 00:00:00 2001 From: tarcisio Date: Wed, 10 Jun 2026 03:09:27 +0000 Subject: [PATCH 39/48] Set profiles.platformToolRequires instead of platformToolRequires --- src/modules/languages/cplusplus.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/languages/cplusplus.nix b/src/modules/languages/cplusplus.nix index ac6b722d2..2bf90b0c9 100644 --- a/src/modules/languages/cplusplus.nix +++ b/src/modules/languages/cplusplus.nix @@ -103,7 +103,7 @@ in (lib.mkIf (cfg.enable && cfg.conan.enable) { languages.cplusplus.conan.config.stdenv = lib.mkDefault (if config.stdenv.hasCC then config.stdenv else pkgs.stdenv); languages.cplusplus.conan.config.package = lib.mkDefault cfg.conan.package; - languages.cplusplus.conan.config.platformToolRequires = lib.mkDefault { + languages.cplusplus.conan.config.profiles.platformToolRequires = lib.mkDefault { cmake = cfg.cmake.package.version; }; languages.cplusplus.conan.config.defaults.enable = lib.mkDefault false; From d8e1c06dbaa1e3607a670189c42df9cf37fd1405 Mon Sep 17 00:00:00 2001 From: tarcisio Date: Wed, 10 Jun 2026 03:17:23 +0000 Subject: [PATCH 40/48] Update docs to use profiles.platformToolRequires --- docs/src/individual-docs/languages/cplusplus.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/individual-docs/languages/cplusplus.md b/docs/src/individual-docs/languages/cplusplus.md index 85e917347..d72acc5c8 100644 --- a/docs/src/individual-docs/languages/cplusplus.md +++ b/docs/src/individual-docs/languages/cplusplus.md @@ -48,7 +48,7 @@ There correspond the following conan-flake options: buildType = "Debug"; compilerCppStd = "14"; - platformToolRequires = { + profiles.platformToolRequires = { cmake = pkgs.cmake.version; }; @@ -82,7 +82,7 @@ languages.cplusplus = { 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; it's not necessary to set the `languages.cplusplus.conan.config.platformToolRequires.cmake` and `languages.cplusplus.conan.config.devShell.tools` options explicitly +- Conan is configured to use the same CMake available in the developmemnt shell; it's not necessary to set the `languages.cplusplus.conan.config.profiles.platformToolRequires.cmake` and `languages.cplusplus.conan.config.devShell.tools` options explicitly ### In Action: From 1b5e3fa1cd99e3d4d0d4435055ac106e6d98941e Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 10 Jun 2026 03:22:22 +0000 Subject: [PATCH 41/48] Auto generate missing individual markdowns --- docs/src/languages/cplusplus.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/languages/cplusplus.md b/docs/src/languages/cplusplus.md index 19087a24a..467f293ec 100644 --- a/docs/src/languages/cplusplus.md +++ b/docs/src/languages/cplusplus.md @@ -49,7 +49,7 @@ There correspond the following conan-flake options: buildType = "Debug"; compilerCppStd = "14"; - platformToolRequires = { + profiles.platformToolRequires = { cmake = pkgs.cmake.version; }; @@ -83,7 +83,7 @@ languages.cplusplus = { 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; it's not necessary to set the `languages.cplusplus.conan.config.platformToolRequires.cmake` and `languages.cplusplus.conan.config.devShell.tools` options explicitly +- Conan is configured to use the same CMake available in the developmemnt shell; it's not necessary to set the `languages.cplusplus.conan.config.profiles.platformToolRequires.cmake` and `languages.cplusplus.conan.config.devShell.tools` options explicitly ### In Action: From e5b3e8fcf0fb4599b631f8b2a552cac54852801d Mon Sep 17 00:00:00 2001 From: tarcisio Date: Wed, 10 Jun 2026 23:11:22 +0000 Subject: [PATCH 42/48] Tweak docs --- docs/src/individual-docs/languages/cplusplus.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/individual-docs/languages/cplusplus.md b/docs/src/individual-docs/languages/cplusplus.md index d72acc5c8..e24148287 100644 --- a/docs/src/individual-docs/languages/cplusplus.md +++ b/docs/src/individual-docs/languages/cplusplus.md @@ -53,7 +53,7 @@ There correspond the following conan-flake options: }; devShell = { - # Programs you want to make available in the shell. + # Programs you want to make available in the shell: tools = { inherit (pkgs) cmake; }; From 2c6b10c50ca1243334c6cd9e8d738b49cf64b869 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 10 Jun 2026 23:25:21 +0000 Subject: [PATCH 43/48] Auto generate missing individual markdowns --- docs/src/languages/cplusplus.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/languages/cplusplus.md b/docs/src/languages/cplusplus.md index 467f293ec..c5e0401b0 100644 --- a/docs/src/languages/cplusplus.md +++ b/docs/src/languages/cplusplus.md @@ -54,7 +54,7 @@ There correspond the following conan-flake options: }; devShell = { - # Programs you want to make available in the shell. + # Programs you want to make available in the shell: tools = { inherit (pkgs) cmake; }; From a671fb83444afc5d1112e70fb4b6a22fa2613a68 Mon Sep 17 00:00:00 2001 From: tarcisio Date: Fri, 12 Jun 2026 02:25:36 +0000 Subject: [PATCH 44/48] Update to use profiles.settings --- .../individual-docs/languages/cplusplus.md | 61 +++++++++++++------ src/modules/languages/cplusplus.nix | 6 +- tests/cplusplus-conan-llvm-devenv/devenv.nix | 19 ++++-- tests/cplusplus-conan-llvm/devenv.nix | 19 ++++-- tests/cplusplus-conan-recipe/devenv.nix | 2 +- 5 files changed, 80 insertions(+), 27 deletions(-) diff --git a/docs/src/individual-docs/languages/cplusplus.md b/docs/src/individual-docs/languages/cplusplus.md index e24148287..d0a06b62f 100644 --- a/docs/src/individual-docs/languages/cplusplus.md +++ b/docs/src/individual-docs/languages/cplusplus.md @@ -45,18 +45,19 @@ There correspond the following conan-flake options: ```nix { - buildType = "Debug"; compilerCppStd = "14"; - profiles.platformToolRequires = { - cmake = pkgs.cmake.version; + profiles = { + settings.build_type = "Debug"; + + platformToolRequires = { + cmake = pkgs.cmake.version; + }; }; devShell = { # Programs you want to make available in the shell: - tools = { - inherit (pkgs) cmake; - }; + tools = { inherit (pkgs) cmake; }; }; } ``` @@ -72,7 +73,7 @@ languages.cplusplus = { enable = true; install.enable = true; config = { - buildType = "Debug"; + profiles.settings.build_type = "Debug"; compilerCppStd = "14"; }; }; @@ -82,7 +83,7 @@ languages.cplusplus = { 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; it's not necessary to set the `languages.cplusplus.conan.config.profiles.platformToolRequires.cmake` and `languages.cplusplus.conan.config.devShell.tools` options explicitly +- Conan is configured to use the same CMake available in the developmemnt shell; as can be seen from the above example, the devenv integration automatically takes care of the CMake part by default, and the `profiles.platformToolRequires` and `devShell.tools` options are not required to be set explicitly in the `languages.cplusplus.conan.config` namespace ### In Action: @@ -101,8 +102,14 @@ conan profile show # This would show the configured profile. If you would like to integrate with the LLVM compiler infrastructure: ```nix -{ pkgs, ... }: - +{ pkgs, config, lib, ... }: +let + inherit (lib) getExe; + getCommand = package: builtins.baseNameOf (getExe package); + cfg = config.languages.cplusplus.conan.config; + c = "'c': '${getExe cfg.stdenv.cc}'"; + cpp = "'cpp': '${builtins.dirOf (getExe cfg.stdenv.cc)}/clang++'"; +in { languages.cplusplus = { enable = true; @@ -110,15 +117,22 @@ If you would like to integrate with the LLVM compiler infrastructure: enable = true; install.enable = true; config = { + profiles = { + settings.build_type = "Release"; + conf = { + "tools.build:compiler_executables" = "{${c}, ${cpp}}"; + }; + }; stdenv = pkgs.overrideCC ( pkgs.llvmPackages.libcxxStdenv.override { targetPlatform.useLLVM = true; + targetPlatform.linker = "lld"; } ) pkgs.llvmPackages.clangUseLLVM; - # By default: compiler.libcxx=libstdc++11, so undo it: - compilerLibCxx = null; + # By default: compiler.libcxx=libstdc++11, so set it: + compilerLibCxx = "libc++"; }; }; }; @@ -128,13 +142,20 @@ If you would like to integrate with the LLVM compiler infrastructure: Or even: ```nix -{ pkgs, ... }: - +{ pkgs, config, lib, ... }: +let + inherit (lib) getExe; + getCommand = package: builtins.baseNameOf (getExe package); + cfg = config.languages.cplusplus.conan.config; + c = "'c': '${getExe cfg.stdenv.cc}'"; + cpp = "'cpp': '${builtins.dirOf (getExe cfg.stdenv.cc)}/clang++'"; +in { stdenv = pkgs.overrideCC ( pkgs.llvmPackages.libcxxStdenv.override { targetPlatform.useLLVM = true; + targetPlatform.linker = "lld"; } ) pkgs.llvmPackages.clangUseLLVM; @@ -145,8 +166,14 @@ Or even: enable = true; install.enable = true; config = { - # By default: compiler.libcxx=libstdc++11, so undo it: - compilerLibCxx = null; + profiles = { + settings.build_type = "Release"; + conf = { + "tools.build:compiler_executables" = "{${c}, ${cpp}}"; + }; + }; + # By default: compiler.libcxx=libstdc++11, so set it: + compilerLibCxx = "libc++"; }; }; }; @@ -182,7 +209,7 @@ With [local-recipe-index](https://docs.conan.io/2/tutorial/conan_repositories/se install.enable = true; config = { - buildType = "Release"; + profiles.settings.build_type = "Release"; compilerCppStd = "17"; remotes.local = { diff --git a/src/modules/languages/cplusplus.nix b/src/modules/languages/cplusplus.nix index 2bf90b0c9..8291198f0 100644 --- a/src/modules/languages/cplusplus.nix +++ b/src/modules/languages/cplusplus.nix @@ -106,7 +106,11 @@ in languages.cplusplus.conan.config.profiles.platformToolRequires = lib.mkDefault { cmake = cfg.cmake.package.version; }; - languages.cplusplus.conan.config.defaults.enable = lib.mkDefault false; + languages.cplusplus.conan.config.devShell.tools = lib.mkDefault { + conan = null; + cmake = null; + "${cfg.package.cc.pname}" = null; + }; languages.cplusplus.package = lib.mkDefault cfg.conan.config.stdenv.cc; }) diff --git a/tests/cplusplus-conan-llvm-devenv/devenv.nix b/tests/cplusplus-conan-llvm-devenv/devenv.nix index a29fc46a6..8a7eba75b 100644 --- a/tests/cplusplus-conan-llvm-devenv/devenv.nix +++ b/tests/cplusplus-conan-llvm-devenv/devenv.nix @@ -1,12 +1,17 @@ -{ pkgs, config, ... }: +{ pkgs, config, lib, ... }: let - getCommand = package: builtins.baseNameOf (pkgs.lib.getExe package); + inherit (lib) getExe; + getCommand = package: builtins.baseNameOf (getExe package); + cfg = config.languages.cplusplus.conan.config; + c = "'c': '${getExe cfg.stdenv.cc}'"; + cpp = "'cpp': '${builtins.dirOf (getExe cfg.stdenv.cc)}/clang++'"; in { stdenv = pkgs.overrideCC ( pkgs.llvmPackages.libcxxStdenv.override { targetPlatform.useLLVM = true; + targetPlatform.linker = "lld"; } ) pkgs.llvmPackages.clangUseLLVM; @@ -17,8 +22,14 @@ in enable = true; install.enable = true; config = { - # By default: compiler.libcxx=libstdc++11, so undo it: - compilerLibCxx = null; + profiles = { + settings.build_type = "Release"; + conf = { + "tools.build:compiler_executables" = "{${c}, ${cpp}}"; + }; + }; + # By default: compiler.libcxx=libstdc++11, so set it: + compilerLibCxx = "libc++"; }; }; }; diff --git a/tests/cplusplus-conan-llvm/devenv.nix b/tests/cplusplus-conan-llvm/devenv.nix index f895b7fa8..a223d4c5e 100644 --- a/tests/cplusplus-conan-llvm/devenv.nix +++ b/tests/cplusplus-conan-llvm/devenv.nix @@ -1,6 +1,10 @@ -{ pkgs, config, ... }: +{ pkgs, config, lib, ... }: let - getCommand = package: builtins.baseNameOf (pkgs.lib.getExe package); + inherit (lib) getExe; + getCommand = package: builtins.baseNameOf (getExe package); + cfg = config.languages.cplusplus.conan.config; + c = "'c': '${getExe cfg.stdenv.cc}'"; + cpp = "'cpp': '${builtins.dirOf (getExe cfg.stdenv.cc)}/clang++'"; in { languages.cplusplus = { @@ -9,15 +13,22 @@ in enable = true; install.enable = true; config = { + profiles = { + settings.build_type = "Release"; + conf = { + "tools.build:compiler_executables" = "{${c}, ${cpp}}"; + }; + }; stdenv = pkgs.overrideCC ( pkgs.llvmPackages.libcxxStdenv.override { targetPlatform.useLLVM = true; + targetPlatform.linker = "lld"; } ) pkgs.llvmPackages.clangUseLLVM; - # By default: compiler.libcxx=libstdc++11, so undo it: - compilerLibCxx = null; + # By default: compiler.libcxx=libstdc++11, so set it: + compilerLibCxx = "libc++"; }; }; }; diff --git a/tests/cplusplus-conan-recipe/devenv.nix b/tests/cplusplus-conan-recipe/devenv.nix index ae823102d..da05be691 100644 --- a/tests/cplusplus-conan-recipe/devenv.nix +++ b/tests/cplusplus-conan-recipe/devenv.nix @@ -9,7 +9,7 @@ in enable = true; install.enable = true; config = { - buildType = "Release"; + profiles.settings.build_type = "Release"; compilerCppStd = "17"; remotes.local = { url = "./repo"; From da7f757bffc8cddd9f4007d45fd1269471361df6 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 12 Jun 2026 02:30:38 +0000 Subject: [PATCH 45/48] Auto generate missing individual markdowns --- docs/src/languages/cplusplus.md | 61 ++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 17 deletions(-) diff --git a/docs/src/languages/cplusplus.md b/docs/src/languages/cplusplus.md index c5e0401b0..f0a6bb244 100644 --- a/docs/src/languages/cplusplus.md +++ b/docs/src/languages/cplusplus.md @@ -46,18 +46,19 @@ There correspond the following conan-flake options: ```nix { - buildType = "Debug"; compilerCppStd = "14"; - profiles.platformToolRequires = { - cmake = pkgs.cmake.version; + profiles = { + settings.build_type = "Debug"; + + platformToolRequires = { + cmake = pkgs.cmake.version; + }; }; devShell = { # Programs you want to make available in the shell: - tools = { - inherit (pkgs) cmake; - }; + tools = { inherit (pkgs) cmake; }; }; } ``` @@ -73,7 +74,7 @@ languages.cplusplus = { enable = true; install.enable = true; config = { - buildType = "Debug"; + profiles.settings.build_type = "Debug"; compilerCppStd = "14"; }; }; @@ -83,7 +84,7 @@ languages.cplusplus = { 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; it's not necessary to set the `languages.cplusplus.conan.config.profiles.platformToolRequires.cmake` and `languages.cplusplus.conan.config.devShell.tools` options explicitly +- Conan is configured to use the same CMake available in the developmemnt shell; as can be seen from the above example, the devenv integration automatically takes care of the CMake part by default, and the `profiles.platformToolRequires` and `devShell.tools` options are not required to be set explicitly in the `languages.cplusplus.conan.config` namespace ### In Action: @@ -102,8 +103,14 @@ conan profile show # This would show the configured profile. If you would like to integrate with the LLVM compiler infrastructure: ```nix -{ pkgs, ... }: - +{ pkgs, config, lib, ... }: +let + inherit (lib) getExe; + getCommand = package: builtins.baseNameOf (getExe package); + cfg = config.languages.cplusplus.conan.config; + c = "'c': '${getExe cfg.stdenv.cc}'"; + cpp = "'cpp': '${builtins.dirOf (getExe cfg.stdenv.cc)}/clang++'"; +in { languages.cplusplus = { enable = true; @@ -111,15 +118,22 @@ If you would like to integrate with the LLVM compiler infrastructure: enable = true; install.enable = true; config = { + profiles = { + settings.build_type = "Release"; + conf = { + "tools.build:compiler_executables" = "{${c}, ${cpp}}"; + }; + }; stdenv = pkgs.overrideCC ( pkgs.llvmPackages.libcxxStdenv.override { targetPlatform.useLLVM = true; + targetPlatform.linker = "lld"; } ) pkgs.llvmPackages.clangUseLLVM; - # By default: compiler.libcxx=libstdc++11, so undo it: - compilerLibCxx = null; + # By default: compiler.libcxx=libstdc++11, so set it: + compilerLibCxx = "libc++"; }; }; }; @@ -129,13 +143,20 @@ If you would like to integrate with the LLVM compiler infrastructure: Or even: ```nix -{ pkgs, ... }: - +{ pkgs, config, lib, ... }: +let + inherit (lib) getExe; + getCommand = package: builtins.baseNameOf (getExe package); + cfg = config.languages.cplusplus.conan.config; + c = "'c': '${getExe cfg.stdenv.cc}'"; + cpp = "'cpp': '${builtins.dirOf (getExe cfg.stdenv.cc)}/clang++'"; +in { stdenv = pkgs.overrideCC ( pkgs.llvmPackages.libcxxStdenv.override { targetPlatform.useLLVM = true; + targetPlatform.linker = "lld"; } ) pkgs.llvmPackages.clangUseLLVM; @@ -146,8 +167,14 @@ Or even: enable = true; install.enable = true; config = { - # By default: compiler.libcxx=libstdc++11, so undo it: - compilerLibCxx = null; + profiles = { + settings.build_type = "Release"; + conf = { + "tools.build:compiler_executables" = "{${c}, ${cpp}}"; + }; + }; + # By default: compiler.libcxx=libstdc++11, so set it: + compilerLibCxx = "libc++"; }; }; }; @@ -183,7 +210,7 @@ With [local-recipe-index](https://docs.conan.io/2/tutorial/conan_repositories/se install.enable = true; config = { - buildType = "Release"; + profiles.settings.build_type = "Release"; compilerCppStd = "17"; remotes.local = { From db15aeaf98f761e86646748e8c07938d48f869b5 Mon Sep 17 00:00:00 2001 From: tarcisio Date: Fri, 12 Jun 2026 03:57:24 +0000 Subject: [PATCH 46/48] Improve docs --- docs/src/individual-docs/languages/cplusplus.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/individual-docs/languages/cplusplus.md b/docs/src/individual-docs/languages/cplusplus.md index d0a06b62f..1bafb8107 100644 --- a/docs/src/individual-docs/languages/cplusplus.md +++ b/docs/src/individual-docs/languages/cplusplus.md @@ -64,7 +64,7 @@ There correspond the following conan-flake options: 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: +Config the `devenv.nix` file accordingly. For example, the above is equivalent to the following: ```nix languages.cplusplus = { From 291e178fe77da6402352e5352a431013db8f6b03 Mon Sep 17 00:00:00 2001 From: tarcisio Date: Fri, 12 Jun 2026 03:59:46 +0000 Subject: [PATCH 47/48] Improve docs --- docs/src/individual-docs/languages/cplusplus.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/src/individual-docs/languages/cplusplus.md b/docs/src/individual-docs/languages/cplusplus.md index 1bafb8107..f8c1c8138 100644 --- a/docs/src/individual-docs/languages/cplusplus.md +++ b/docs/src/individual-docs/languages/cplusplus.md @@ -105,7 +105,6 @@ If you would like to integrate with the LLVM compiler infrastructure: { pkgs, config, lib, ... }: let inherit (lib) getExe; - getCommand = package: builtins.baseNameOf (getExe package); cfg = config.languages.cplusplus.conan.config; c = "'c': '${getExe cfg.stdenv.cc}'"; cpp = "'cpp': '${builtins.dirOf (getExe cfg.stdenv.cc)}/clang++'"; @@ -145,7 +144,6 @@ Or even: { pkgs, config, lib, ... }: let inherit (lib) getExe; - getCommand = package: builtins.baseNameOf (getExe package); cfg = config.languages.cplusplus.conan.config; c = "'c': '${getExe cfg.stdenv.cc}'"; cpp = "'cpp': '${builtins.dirOf (getExe cfg.stdenv.cc)}/clang++'"; From 4cbb09c70d16270d992eed182402ea379b702b96 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 12 Jun 2026 04:04:43 +0000 Subject: [PATCH 48/48] Auto generate missing individual markdowns --- docs/src/languages/cplusplus.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/src/languages/cplusplus.md b/docs/src/languages/cplusplus.md index f0a6bb244..3c494551a 100644 --- a/docs/src/languages/cplusplus.md +++ b/docs/src/languages/cplusplus.md @@ -65,7 +65,7 @@ There correspond the following conan-flake options: 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: +Config the `devenv.nix` file accordingly. For example, the above is equivalent to the following: ```nix languages.cplusplus = { @@ -106,7 +106,6 @@ If you would like to integrate with the LLVM compiler infrastructure: { pkgs, config, lib, ... }: let inherit (lib) getExe; - getCommand = package: builtins.baseNameOf (getExe package); cfg = config.languages.cplusplus.conan.config; c = "'c': '${getExe cfg.stdenv.cc}'"; cpp = "'cpp': '${builtins.dirOf (getExe cfg.stdenv.cc)}/clang++'"; @@ -146,7 +145,6 @@ Or even: { pkgs, config, lib, ... }: let inherit (lib) getExe; - getCommand = package: builtins.baseNameOf (getExe package); cfg = config.languages.cplusplus.conan.config; c = "'c': '${getExe cfg.stdenv.cc}'"; cpp = "'cpp': '${builtins.dirOf (getExe cfg.stdenv.cc)}/clang++'";