diff --git a/rust/default.nix b/rust/default.nix index beaa8f8..ec6abe7 100644 --- a/rust/default.nix +++ b/rust/default.nix @@ -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"; };