conan-flake
Declarative Configuration for the Conan C/C++ Package Manager
The conan-flake module provides options used to generate a configuration for the Conan C/C++ Package Manager and defines a devShell (conan.outputs.devShell) that can be used directly, or passed in the inputsFrom option as a way to compose with other devShells.
For examples see the conan-flake README.
Installation
To use these options, add to your flake inputs:
conan-flake.url = "git+https://codeberg.org/tarcisio/conan-flake";
and inside the mkFlake:
imports = [
inputs.conan-flake.flakeModule
];
Run nix flake lock and you’re set.
Options
perSystem.conan
Conan configuration
Type: submodule
Default:
{ }
Declared by:
perSystem.conan.package
The Conan package to use.
Type: package
Default:
pkgs.conan
Declared by:
perSystem.conan.arch
Architecture.
Type: null or string
Default: The architecture of the system.
Declared by:
perSystem.conan.buildType
Build type.
Type: null or string
Default:
"Release"
Declared by:
perSystem.conan.compiler
Compiler.
Type: null or string
Default:
stdenv.cc.cc.pname
Declared by:
perSystem.conan.compilerCppStd
Compiler C++ standard.
Type: null or string
Default:
"gnu17"
Declared by:
perSystem.conan.compilerLibCxx
Compiler C++ standard library.
Type: null or string
Default:
"libstdc++11"
Declared by:
perSystem.conan.compilerVersion
Compiler version.
Type: null or string
Default:
stdenv.cc.version
Declared by:
perSystem.conan.conanHome
Relative path to the local Conan home.
Type: relative path not in the Nix store
Default:
"./.conan2"
Declared by:
perSystem.conan.configLocal
Relative path for local configuration files.
Type: relative path not in the Nix store
Default:
"./config"
Declared by:
perSystem.conan.configRoot
Path to the root of the project directory.
Changing this affects certain functionality, like where to look for
conanHome or the directory structure related to the local recipes
index remotes.
Type: absolute path
Declared by:
perSystem.conan.debug
Enable debug mode for devShell.enterShell.
Type: boolean
Default:
false
Example:
true
Declared by:
perSystem.conan.devShell
Development shell configuration.
Type: submodule
Default:
{ }
Declared by:
perSystem.conan.devShell.packages
A list of packages to expose inside the developer environment.
Type: list of package
Default:
[ ]
Declared by:
perSystem.conan.devShell.apple.sdk
The Apple SDK to add to the developer environment on macOS.
If set to null, the system SDK can be used if the shell allows
access to external environment variables.
Type: null or package
Default:
if pkgs.stdenv.isDarwin then pkgs.apple-sdk else null
Example:
pkgs.apple-sdk_15
Declared by:
perSystem.conan.devShell.enterShell
Bash code to execute when entering the shell.
Type: strings concatenated with “\n”
Default:
""
Declared by:
perSystem.conan.devShell.env
Environment variables to be exposed inside the developer environment.
Type: open submodule of lazy attribute set of anything
Default:
{ }
Declared by:
perSystem.conan.devShell.inputsFrom
A list of derivations whose build inputs will be merged into the shell environment.
Type: list of package
Default:
[ ]
Example:
[
pkgs.hello
(pkgs.python3.withPackages (ps: [ ps.numpy ps.pandas ]))
]
Declared by:
perSystem.conan.devShell.name
Name of the project.
Type: null or string
Default:
"conan-shell"
Declared by:
perSystem.conan.devShell.stdenv
The stdenv to use for the developer environment.
Type: package
Default:
stdenv
Declared by:
perSystem.conan.hasImplicitConancenterRemote
Whether to consider the implicit conancenter remote (https://center2.conan.io) during the initial Conan setup or not.
Type: boolean
Default:
true
Declared by:
perSystem.conan.info
Overall information on the configuration.
Type: submodule
Default:
{ }
Declared by:
perSystem.conan.info.configRoot
Information on the path to the root of the project directory.
Type: null or string
Default:
null
Declared by:
perSystem.conan.offline
Whether to enable only local remotes.
Type: boolean
Default:
false
Declared by:
perSystem.conan.os
Operating system.
Type: null or string
Default: The operating system string.
Declared by:
perSystem.conan.outputs
The flake outputs generated for this configuration.
This is an internal option, not meant to be set by the user.
Type: submodule
Declared by:
- conan-flake/nix/modules/configuration/outputs.nix
- conan-flake/nix/modules/configuration/devshell.nix
perSystem.conan.outputs.packages
Package set containing the generated Conan configuration.
Type: lazy attribute set of package
Default:
{ }
Declared by:
perSystem.conan.outputs.commands
Commands to install the generated configuration.
Type: lazy attribute set of (submodule)
Declared by:
perSystem.conan.outputs.commands.<name>.enterShell
List of commands required to run in shell hooks according to lines
merging logic.
Type: strings concatenated with “\n”
Declared by:
perSystem.conan.outputs.commands.<name>.kind
The kind of commands, used to determine how to group them together.
Type: one of “configuration”, “package”, “enterShell”, “info”
Declared by:
perSystem.conan.outputs.configuration
The generated Conan configuration.
Type: lazy attribute set of (submodule)
Declared by:
perSystem.conan.outputs.configuration.<name>.package
The configuration-outputing derivation generated.
Type: package
Declared by:
perSystem.conan.outputs.configuration.<name>.kind
The kind of package, used to determine how to group packages together.
Type: one of “configuration”, “package”, “enterShell”, “info”
Declared by:
perSystem.conan.outputs.configuration.<name>.manifest
For configuration packages, the intended relative path for the
configuration file, in the case package is a file. Otherwise, a
list of relative paths to the package’s output configuration files.
Type: null or relative path not in the Nix store or list of relative path not in the Nix store
Default:
null
Declared by:
perSystem.conan.outputs.devShell
The development shell derivation generated for this project.
Type: package (read only)
Declared by:
perSystem.conan.outputs.links
Paths to link after the configuration is generated.
Type: lazy attribute set of (submodule)
Declared by:
perSystem.conan.outputs.links.<name>.kind
The kind of links, used to determine how to group them together.
Type: one of “configuration”, “package”, “enterShell”, “info”
Declared by:
perSystem.conan.outputs.links.<name>.relativePaths
List of relative paths to link.
Type: list of relative path not in the Nix store
Default:
[ ]
Declared by:
perSystem.conan.platformToolRequires
Platform tool requires.
Type: attribute set of string
Default:
{ }
Declared by:
perSystem.conan.profiles
Conan profiles.
Type: submodule
Declared by:
perSystem.conan.profiles.platformToolRequires
Profile platform tool requires.
Type: attribute set of string
Default:
{ }
Declared by:
perSystem.conan.profiles.settings
Profile settings.
Type: attribute set of string
Default:
{ }
Declared by:
perSystem.conan.profiles.text
The profile-outputing derivation generated for the configuration.
Type: package (read only)
Default:
pkgs.writeText "profile" \'\'
[settings]
${lib.strings.concatMapAttrsStringSep "\n" (
name: value: "${name}=${value}"
) config.settings}
[platform_tool_requires]
${lib.strings.concatMapAttrsStringSep "\n" (
name: value: "${name}/${value}"
) config.platformToolRequires}
\'\'
Declared by:
perSystem.conan.remotes
Conan remote repositories.
Type: lazy attribute set of (submodule)
Default:
{ }
Declared by:
perSystem.conan.remotes.<name>.enable
Enable this remote.
Type: boolean
Default:
true
Declared by:
perSystem.conan.remotes.<name>.allowedPackages
Allowed packages.
Type: null or (list of string)
Default:
null
Declared by:
perSystem.conan.remotes.<name>.local
Whether this remote is of local-recipes-index type.
Type: boolean
Default:
false
Declared by:
perSystem.conan.remotes.<name>.name
Name of the remote.
Type: string
Default: remote’s name
Declared by:
perSystem.conan.remotes.<name>.url
Remote’s URL.
Type: relative path not in the Nix store or string
Declared by:
perSystem.conan.remotes.<name>.verifySsl
Whether to verify SSL.
Type: boolean
Default:
true
Declared by:
perSystem.conan.settings
Conan user settings (settings_user.yml).
Type: submodule
Declared by:
perSystem.conan.settings.base
Base user settings.
Type: attribute set
Default:
{ }
Declared by:
perSystem.conan.settings.user
Default user settings.
Type: attribute set (read only)
Default:
Default user settings computed from the provided base settings,
from pkgs.cudaPackages.backendStdenv, pkgs.gccStdenv, and
pkgs.llvmPackages.libcxxStdenv.
Declared by:
perSystem.conan.settings.yaml
The YAML-outputing derivation generated for the user configuration.
Type: package (read only)
Default:
(pkgs.formats.yaml { }).generate "settings_user.yml" settings.user
Declared by:
perSystem.conan.stdenv
The stdenv derivation to use for the development environment.
Type: package
Default:
pkgs.stdenv
Example:
[
"pkgs.llvmPackages.stdenv"
"pkgs.cudaPackages.backendStdenv"
]
Declared by: