feat(rust): add the krantz.rust.cargoArtifacts.extraAttrs option

This commit is contained in:
2026-06-04 21:28:32 -05:00
parent c95a397e58
commit bc7f84a854
+13 -2
View File
@@ -43,9 +43,9 @@
# Build *just* the cargo dependencies, so we can reuse # Build *just* the cargo dependencies, so we can reuse
# all of that work (e.g. via cachix) when running in CI # all of that work (e.g. via cachix) when running in CI
cargoArtifacts = craneLib.buildDepsOnly { cargoArtifacts = craneLib.buildDepsOnly ({
inherit src buildInputs nativeBuildInputs; inherit src buildInputs nativeBuildInputs;
}; } // cfg.cargoArtifacts.extraAttrs);
in { in {
options.krantz.rust = { options.krantz.rust = {
enable = lib.mkEnableOption "building a cargo project with crane"; enable = lib.mkEnableOption "building a cargo project with crane";
@@ -96,6 +96,17 @@
]; ];
}; };
cargoArtifacts = {
extraAttrs = lib.mkOption {
description = "Extra attributes to merge into buildDepsOnly. See https://crane.dev/API.html#cranelibbuilddepsonly";
type = lib.types.attrs;
default = {};
example = {
doCheck = false;
};
};
};
devShell = { devShell = {
enable = lib.mkEnableOption "a rust development environment" // {default = true;}; enable = lib.mkEnableOption "a rust development environment" // {default = true;};