15 data' = builtins.removeAttrs
16 (if builtins.isPath data then lib.importJSON data else data)
20 if lib.hasPrefix "https://" url then (
22 url' = lib.drop 2 (lib.splitString "/" url);
23 in "https/${builtins.concatStringsSep "/" url'}"
25 else builtins.replaceStrings ["://"] ["/"] url;
29 '' + builtins.concatStringsSep "" (lib.mapAttrsToList (url: info:
31 key = builtins.head (builtins.attrNames info);
34 name = baseNameOf path;
36 redirect = "$out/${urlToPath val}";
37 hash = fetchurl { inherit url; hash = val; };
38 text = writeText name val;
39 }.${key} or (throw "Unknown key: ${url}");
41 mkdir -p "${dirOf path}"
42 ln -s "${source}" "${path}"
45 runCommand name (builtins.removeAttrs attrs [ "name" "data" ] // {
46 passthru = (attrs.passthru or {}) // {
47 data = writeText "deps.json" (builtins.toJSON data);