Merge pull request #90 from DarkKirb/fix-hydra-eval-jobs

fix resolve-jobs
This commit is contained in:
Charlotte 🦝 Delenk 2022-12-08 11:43:05 +01:00 committed by GitHub
commit b39d9ebbcc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,8 +4,11 @@
# calls the flake's 'outputs' function. It then returns an attrset
# containing 'defaultNix' (to be used in 'default.nix'), 'shellNix'
# (to be used in 'shell.nix').
_: let
inherit (builtins) attrNames listToAttrs concatMap;
let
inherit (builtins) attrNames listToAttrs;
mapAttrs' = f: set:
listToAttrs (map (attr: f attr set.${attr}) (attrNames set));
flake_compat = src: let
lockFilePath = src + "/flake.lock";
@ -271,17 +274,17 @@ _: let
result.hydraJobs;
prs = builtins.fromJSON (builtins.readFile <prs>);
filteredPrs = builtins.filter (f: f.state == "open") prs;
srcs = listToAttrs (map
(value: {
name = "pr${value.id}";
srcs =
mapAttrs'
(n: value: {
name = "pr${n}";
value =
builtins.fetchGit
{
url = "${value.head.repo.clone_url}";
url = "https://github.com/${value.head.repo.owner.login}/${value.head.repo.name}.git";
ref = "${value.head.ref}";
};
})
filteredPrs);
prs;
in
builtins.mapAttrs (_: flake_compat) srcs