don’t nest jobsets

This commit is contained in:
Charlotte 🦝 Delenk 2023-01-21 11:06:21 +01:00
parent 511964d74f
commit 1d1046fbda
Signed by: darkkirb
GPG key ID: AB2BD8DAF2E37122

View file

@ -7,8 +7,10 @@
systems = ["x86_64-linux" "aarch64-linux" "riscv64-linux"]; systems = ["x86_64-linux" "aarch64-linux" "riscv64-linux"];
nixpkgs_version = ["master" "nixos-22.05"]; nixpkgs_version = ["master" "nixos-22.05"];
mkJobsets = system: version: mkJobsets = system: version:
(pkgs.lib.mapAttrs ( (pkgs.lib.mapAttrs' (
num: info: { num: info: {
name = "${system}-${version}-pr${num}";
value = {
enabled = 1; enabled = 1;
hidden = false; hidden = false;
description = "PR ${num} (${system}-${version}): ${info.title}"; description = "PR ${num} (${system}-${version}): ${info.title}";
@ -35,11 +37,12 @@
value = system; value = system;
}; };
}; };
};
} }
) )
prs) prs)
// { // {
main = { "${system}-${version}" = {
enabled = 1; enabled = 1;
hidden = false; hidden = false;
description = "nix-packages ${system}-${version}"; description = "nix-packages ${system}-${version}";
@ -69,17 +72,7 @@
}; };
}; };
mapToAttrs = f: list: pkgs.lib.listToAttrs (map f list); concatAttrs = pkgs.lib.foldr (a: b: a // b) {};
jobsets = jobsets = concatAttrs (pkgs.lib.concatMap (system: map (version: mkJobsets system version) nixpkgs_version) systems);
mapToAttrs (system: {
name = system;
value =
mapToAttrs (version: {
name = version;
value = mkJobsets system version;
})
nixpkgs_version;
})
systems;
in {jobsets = pkgs.writeText "jobsets.json" (builtins.toJSON jobsets);} in {jobsets = pkgs.writeText "jobsets.json" (builtins.toJSON jobsets);}