-
Notifications
You must be signed in to change notification settings - Fork 5
/
jobsets.nix
53 lines (52 loc) · 1.3 KB
/
jobsets.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{ wasm-cross-prs }:
let
pkgs = import ./nixpkgs {};
mkFetchGithub = value: {
inherit value;
type = "git";
emailresponsible = false;
};
in
with pkgs.lib;
let
defaults = jobs: {
inherit (jobs) description;
enabled = 1;
hidden = false;
keepnr = 10;
schedulingshares = 100;
checkinterval = 120;
enableemail = false;
emailoverride = "";
nixexprinput = "wasm-cross";
nixexprpath = "release.nix";
inputs = jobs.inputs;
};
branchJobset = branch: defaults {
description = "wasm-cross-${branch}";
inputs = {
wasm-cross = {
value = "https://github.com/WebGHC/wasm-cross.git ${branch}";
type = "git";
emailresponsible = false;
};
};
};
makePr = num: info: {
name = "wasm-cross-pr-${num}";
value = defaults {
description = "#${num}: ${info.title}";
inputs = {
wasm-cross = {
value = "https://github.com/${info.head.repo.owner.login}/${info.head.repo.name}.git ${info.head.ref}";
type = "git";
emailresponsible = false;
};
};
};
};
prs = mapAttrs' makePr (builtins.fromJSON (builtins.readFile wasm-cross-prs));
jobsetsAttrs = prs // genAttrs ["master"] branchJobset;
in {
jobsets = pkgs.writeText "spec.json" (builtins.toJSON jobsetsAttrs);
}