Vastly simplify artifact extraction

This commit is contained in:
Tad Fisher
2024-05-23 17:26:32 -07:00
parent 43c4b71928
commit 4910251482
48 changed files with 1248 additions and 9576 deletions

View File

@@ -119,14 +119,12 @@ let
# Fetch urls using the scheme for the first entry only; there isn't a
# straightforward way to tell Nix to try multiple fetchers in turn
# and short-circuit on the first successful fetch.
fetch = name: { urls, hash }:
fetch = name: { url, hash }:
let
first = head urls;
scheme = head (builtins.match "([a-z0-9+.-]+)://.*" first);
scheme = head (builtins.match "([a-z0-9+.-]+)://.*" url);
fetch' = getAttr scheme fetchers';
urls' = filter (hasPrefix scheme) urls;
in
fetch' { urls = urls'; inherit hash; };
fetch' { inherit url hash; };
mkModule = id: artifacts:
let