nixos-config/hydra/jobsets.nix

56 lines
1.5 KiB
Nix
Raw Normal View History

2023-01-21 16:06:26 +00:00
{
prsJSON,
nixpkgs,
}: let
pkgs = import nixpkgs {};
prs = builtins.fromJSON (builtins.readFile prsJSON);
jobsets =
2023-04-05 07:56:35 +00:00
(pkgs.lib.mapAttrs' (
2023-01-23 13:51:09 +00:00
num: info: {
2023-04-05 07:56:35 +00:00
name = "pr${num}";
value = {
enabled = 1;
hidden = false;
description = "PR ${num}: ${info.title}";
nixexprinput = "nixos-config";
nixexprpath = "hydra/default.nix";
checkinterval = 300;
schedulingshares = 100;
enableemail = false;
emailoverride = "";
keepnr = 1;
inputs = {
nixos-config = {
type = "git";
value = "https://github.com/${info.head.repo.owner.login}/${info.head.repo.name}.git ${info.head.ref}";
emailresponsible = false;
};
2023-01-23 13:51:09 +00:00
};
2023-01-21 16:06:26 +00:00
};
2023-01-23 13:51:09 +00:00
}
)
2023-01-21 16:06:26 +00:00
prs)
// {
nixos-config = {
enabled = 1;
hidden = false;
description = "Current nixos config";
nixexprinput = "nixos-config";
nixexprpath = "hydra/default.nix";
checkinterval = 300;
schedulingshares = 100;
enableemail = false;
emailoverride = "";
keepnr = 1;
inputs = {
nixos-config = {
type = "git";
value = "https://github.com/DarkKirb/nixos-config.git main";
emailresponsible = false;
};
};
};
};
in {jobsets = pkgs.writeText "jobsets.json" (builtins.toJSON jobsets);}