nixos-config/hydra/jobsets.nix

81 lines
2.3 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-09 12:04:52 +00:00
(builtins.listToAttrs (
2023-10-18 09:10:18 +00:00
pkgs.lib.attrsets.mapAttrsToList (
_: info: {
2023-04-09 12:04:52 +00:00
name = "pr${toString info.number}";
2023-04-05 07:56:35 +00:00
value = {
2023-04-09 12:04:52 +00:00
enabled = info.state == "open";
hidden = info.state != "open";
description = "PR ${toString info.number}: ${info.title}";
2023-04-05 07:56:35 +00:00
nixexprinput = "nixos-config";
nixexprpath = "hydra/default.nix";
2023-04-09 12:04:52 +00:00
checkinterval = 3600;
2023-04-05 07:56:35 +00:00
schedulingshares = 100;
enableemail = false;
emailoverride = "";
keepnr = 1;
inputs = {
nixos-config = {
type = "git";
2023-04-09 12:04:52 +00:00
value = "${info.head.repo.clone_url} ${info.head.ref}";
emailresponsible = false;
};
2023-10-18 09:10:18 +00:00
github_input = {
2023-04-09 12:04:52 +00:00
type = "string";
value = "nixos-config";
};
2023-10-18 09:10:18 +00:00
github_repo_owner = {
2023-04-09 12:04:52 +00:00
type = "string";
2023-10-18 09:10:18 +00:00
value = info.head.repo.owner.login;
2023-04-09 12:04:52 +00:00
};
2023-10-18 09:10:18 +00:00
github_repo_name = {
2023-04-09 12:04:52 +00:00
type = "string";
2023-10-18 09:10:18 +00:00
value = info.head.repo.name;
2023-04-05 07:56:35 +00:00
};
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-04-09 12:04:52 +00:00
prs
))
2023-01-21 16:06:26 +00:00
// {
nixos-config = {
enabled = 1;
hidden = false;
description = "Current nixos config";
nixexprinput = "nixos-config";
nixexprpath = "hydra/default.nix";
2023-04-09 12:04:52 +00:00
checkinterval = 0;
2023-01-21 16:06:26 +00:00
schedulingshares = 100;
enableemail = false;
emailoverride = "";
keepnr = 1;
inputs = {
nixos-config = {
type = "git";
2023-10-18 09:10:18 +00:00
value = "https://github.com/DarkKirb/nixos-config main";
emailresponsible = false;
};
2023-10-18 09:10:18 +00:00
github_input = {
2023-04-09 12:04:52 +00:00
type = "string";
value = "nixos-config";
};
2023-10-18 09:10:18 +00:00
github_repo_owner = {
2023-04-09 12:04:52 +00:00
type = "string";
2023-10-18 09:10:18 +00:00
value = "DarkKirb";
2023-04-09 12:04:52 +00:00
};
2023-10-18 09:10:18 +00:00
github_repo_name = {
2023-04-09 12:04:52 +00:00
type = "string";
2023-10-18 09:10:18 +00:00
value = "nixos-config";
2023-01-21 16:06:26 +00:00
};
};
};
};
in {jobsets = pkgs.writeText "jobsets.json" (builtins.toJSON jobsets);}