diff options
Diffstat (limited to 'nix/readTree')
-rw-r--r-- | nix/readTree/default.nix | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/nix/readTree/default.nix b/nix/readTree/default.nix index 7c48d177fb39..f433b2736061 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; |