/
default.nix
43 lines (42 loc) · 1.21 KB
/
default.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
{ pulls ? ../simple-pr-dummy.json }:
let
pkgs = import <nixpkgs>{};
in with import ../lib.nix;
with pkgs.lib;
let
defaults = {
enabled = 1;
hidden = false;
keepnr = 10;
schedulingshares = 100;
checkinterval = 600;
enableemail = false;
emailoverride = "";
nixexprinput = "toxvpn";
nixexprpath = "release.nix";
};
primary_jobsets = {
toxvpn-unstable = defaults // {
description = "toxvpn";
inputs = {
toxvpn = mkFetchGithub "https://github.com/cleverca22/toxvpn master";
nixpkgs = mkFetchGithub "https://github.com/nixos/nixpkgs nixos-unstable-small";
};
};
};
pr_data = builtins.fromJSON (builtins.readFile pulls);
makePr = num: info: {
name = "toxvpn-${num}";
value = defaults // {
description = "PR ${num}: ${info.title}";
inputs = {
toxvpn = mkFetchGithub "https://github.com/${info.head.repo.owner.login}/${info.head.repo.name}.git ${info.head.ref}";
nixpkgs = mkFetchGithub "https://github.com/nixos/nixpkgs nixos-unstable-small";
};
};
};
pull_requests = listToAttrs (mapAttrsToList makePr pr_data);
jobsetsAttrs = pull_requests // primary_jobsets;
in {
jobsets = makeSpec jobsetsAttrs;
}