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;
|
|
|
|
};
|
2024-10-13 07:45:37 +00:00
|
|
|
gitea_status_repo = {
|
2023-04-09 12:04:52 +00:00
|
|
|
type = "string";
|
|
|
|
value = "nixos-config";
|
|
|
|
};
|
2024-10-13 07:45:37 +00:00
|
|
|
gitea_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
|
|
|
};
|
2024-10-13 07:45:37 +00:00
|
|
|
gitea_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";
|
2023-07-22 07:00:01 +00:00
|
|
|
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 = {
|
2023-07-22 07:00:01 +00:00
|
|
|
nixos-config = {
|
|
|
|
type = "git";
|
2024-10-13 07:45:37 +00:00
|
|
|
value = "https://git.chir.rs/darkkirb/nixos-config main";
|
2023-07-22 07:00:01 +00:00
|
|
|
emailresponsible = false;
|
|
|
|
};
|
2024-10-13 07:45:37 +00:00
|
|
|
gitea_status_repo = {
|
2023-04-09 12:04:52 +00:00
|
|
|
type = "string";
|
|
|
|
value = "nixos-config";
|
|
|
|
};
|
2024-10-13 07:45:37 +00:00
|
|
|
gitea_repo_owner = {
|
2023-04-09 12:04:52 +00:00
|
|
|
type = "string";
|
2024-10-13 07:45:37 +00:00
|
|
|
value = "Darkkirb";
|
2023-04-09 12:04:52 +00:00
|
|
|
};
|
2024-10-13 07:45:37 +00:00
|
|
|
gitea_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);}
|