fix: don't error if src and srcToolchain is not defined. Just default to nixpkgs toolchain instead.
This commit is contained in:
+3
-2
@@ -52,7 +52,8 @@
|
||||
|
||||
src = lib.mkOption {
|
||||
description = "The path to the root of the crate.";
|
||||
type = lib.types.path;
|
||||
type = lib.types.nullOr lib.types.path;
|
||||
default = null;
|
||||
example = lib.literalExpression "./.";
|
||||
};
|
||||
srcFiltered = lib.mkOption {
|
||||
@@ -65,7 +66,7 @@
|
||||
srcToolchain = lib.mkOption {
|
||||
description = "A path to the rust-toolchain(.toml) file for the repo. Will use the toolchain from nixpkgs if the file does not exist.";
|
||||
type = lib.types.path;
|
||||
default = "${cfg.src}/rust-toolchain.toml";
|
||||
default = "${if cfg.src != null then cfg.src else "/dev/null"}/rust-toolchain.toml";
|
||||
defaultText = lib.literalExpression "cfg.src + \"/rust-toolchain.toml\"";
|
||||
example = lib.literalExpression "./rust-toolchain";
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user