From aff54b572b75af13a6b31108ff7732d17674ad43 Mon Sep 17 00:00:00 2001 From: dusk Date: Sat, 4 Jan 2025 00:16:38 +0900 Subject: [PATCH] feat(buildCrate): allow toolchain to be specified --- src/implementation.nix | 3 ++- src/interface.nix | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/implementation.nix b/src/implementation.nix index e342c608..ef236abd 100644 --- a/src/implementation.nix +++ b/src/implementation.nix @@ -131,6 +131,7 @@ in { drvConfig ? {}, depsDrvConfig ? {}, cratePath ? "", + mkRustToolchain ? nci.toolchains.mkBuild, }: let cargoToml = l.fromTOML (l.readFile ( if cratePath == "" @@ -146,7 +147,7 @@ in { drvConfig { deps.craneSource = inp.crane; - deps.mkRustToolchain = nci.toolchains.mkBuild; + deps.mkRustToolchain = mkRustToolchain; name = l.mkForce cargoToml.package.name; version = l.mkForce cargoToml.package.version; diff --git a/src/interface.nix b/src/interface.nix index 02dd5917..2ddb4610 100644 --- a/src/interface.nix +++ b/src/interface.nix @@ -90,6 +90,7 @@ in { The arguments are: - `src`: the source for the project (or crate if it's just a crate) - `cratePath`: relative path to the provided `src`, used to find the crate if it's a workspace + - `mkRustToolchain`: function that outputs a rust toolchain package (like `nci.toolchains.mkBuild`, which is also the default), will be used when building - `drvConfig` and `depsDrvConfig`: see `nci.crates..` in this documentation (optional) ''; };