From 0c581ed8b03610ae256d5444317840507182fc47 Mon Sep 17 00:00:00 2001 From: Reed Krantz Date: Mon, 1 Jun 2026 16:11:50 -0500 Subject: [PATCH] fix: don't error if src and srcToolchain is not defined. Just default to nixpkgs toolchain instead. --- rust/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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"; };