Installation

Three installation paths: published crates, Nix flake, and build from source. Pick the one that matches your workflow.

Add Confium to your Cargo.toml:

[dependencies]
confium-core = "0.2"

Or via the CLI:

cargo add confium-core

The cdylib is built as target/{debug,release}/libconfium.{so,dylib,dll} and exposes the cfm_* C ABI.

A fully reproducible dev shell is provided via flake.nix. It pins Rust 1.85+ (edition 2024), cbindgen, CMake, Boost, asciidoctor, and everything else required to build the workspace and run CI locally.

nix develop

Inside the shell, all cargo commands work without further setup:

cargo build --workspace
cargo test --workspace

Option 3: build from source

Prerequisites

  • Rust stable 1.85+ via rustup. The toolchain is pinned in rust-toolchain.toml.
  • CMake 3.15+ (only required for the C-binding tests under cpp-tests/).
  • cbindgen 0.29+ (cargo install cbindgen) — only required to regenerate target/confium.h.
  • Boost (only required for cpp-tests/).
  • Asciidoctor (gem install asciidoctor) — only required to build this docs site.

Clone and build

git clone https://github.com/confium/confium.git
cd confium
cargo build --workspace

Run the test suite

cargo test --workspace

The suite covers 1848+ unit and integration tests across all 65 crates.

Verifying the install

A quick smoke test:

cargo run -p confium-cli -- --version
cargo run -p confium-cli -- hash --algorithm sha256 --input "hello"

Expected output: a version string, then the SHA-256 digest of "hello".

Workspace dependencies

When you depend on multiple Confium crates, prefer the workspace shortcut in your Cargo.toml:

[dependencies]
confium-core.workspace = true
confium-composite.workspace = true
confium-pki.workspace = true

This requires adding the same keys to [workspace.dependencies] in your own workspace root, mirroring the layout in Confium’s own Cargo.toml.

Next steps