diff --git a/nix/readTree/default.nix b/nix/readTree/default.nix index 7c48d177f..f433b2736 100644 --- a/nix/readTree/default.nix +++ b/nix/readTree/default.nix @@ -66,10 +66,9 @@ let else import path; pathType = builtins.typeOf importedFile; imported = - assert assertMsg - (pathType == "lambda") - "readTree: trying to import ${toString path}, but it’s a ${pathType}, you need to make it a function like { depot, pkgs, ... }"; - importedFile (filter (argsWithPath args parts) parts); + if pathType != "lambda" + then builtins.throw "readTree: trying to import ${toString path}, but it’s a ${pathType}, you need to make it a function like { depot, pkgs, ... }" + else importedFile (filter (argsWithPath args parts) parts); in if (isAttrs imported) then imported // (marker parts) else imported;