fetchurl: Add missing arg to toPretty invocation

Thanks to @emilazy for the report:
https://github.com/NixOS/nixpkgs/pull/393136#issuecomment-3268711663

Fixes this crash:

```
… from call site
  at /Users/emily/Developer/nixpkgs/pkgs/build-support/fetchurl/default.nix:194:70:
   193|     else
   194|       throw "fetchurl requires a hash for fixed-output derivation: ${lib.generators.toPretty urls_}";
      |                                                                      ^
   195|

… while evaluating the value passed for the lambda argument
  at /Users/emily/Developer/nixpkgs/lib/generators.nix:524:5:
   523|   toPretty =
   524|     {
      |     ^
   525|       allowPrettyValues ? false,

error: expected a set but found a list: [ "https://cmake.org/files/v4.1/cmake-4.1.1.tar.gz" ]
```

It'll still crash, but with a nicer error message!
This commit is contained in:
Rebecca Turner
2025-09-09 10:04:38 -07:00
parent 5d6119e8f7
commit 3d4fb2c3e6
+1 -1
View File
@@ -191,7 +191,7 @@ let
outputHash = "";
}
else
throw "fetchurl requires a hash for fixed-output derivation: ${lib.generators.toPretty urls_}";
throw "fetchurl requires a hash for fixed-output derivation: ${lib.generators.toPretty { } urls_}";
resolvedUrl =
let