This repository has been archived on 2024-10-13. You can view files and clone it, but cannot push or open issues or pull requests.
nix-packages/hydra/jobsets.nix

111 lines
3.3 KiB
Nix
Raw Permalink Normal View History

2023-01-21 08:41:31 +00:00
{
prsJSON,
nixpkgs,
}: let
pkgs = import nixpkgs {};
prs = builtins.fromJSON (builtins.readFile prsJSON);
2023-03-03 09:13:30 +00:00
systems = ["x86_64-linux" "aarch64-linux"];
2023-03-02 11:43:11 +00:00
nixpkgs_version = ["master"];
2023-01-21 08:41:31 +00:00
mkJobsets = system: version:
2023-04-08 11:40:09 +00:00
(builtins.listToAttrs (
map (
info: {
2023-04-08 10:31:26 +00:00
name = "${system}-${version}-pr${toString info.number}";
2023-01-21 10:06:21 +00:00
value = {
2023-04-08 11:40:09 +00:00
enabled = info.state == "open";
hidden = info.state != "open";
2023-04-08 10:31:26 +00:00
description = "PR ${toString info.number} (${system}-${version}): ${info.title}";
2023-01-21 10:06:21 +00:00
nixexprinput = "nix-packages";
nixexprpath = "hydra/default.nix";
2023-04-08 12:47:45 +00:00
checkinterval = 3600;
2023-01-21 10:06:21 +00:00
schedulingshares = 100;
enableemail = false;
emailoverride = "";
keepnr = 1;
2023-04-08 12:45:49 +00:00
inputs = {
nix-packages = {
type = "git";
2023-04-08 12:50:36 +00:00
value = "${info.head.repo.clone_url} ${info.head.ref}";
2023-04-08 12:45:49 +00:00
emailresponsible = false;
};
nixpkgs = {
type = "git";
value = "https://github.com/NixOS/nixpkgs.git ${version}";
emailresponsible = false;
};
system = {
type = "string";
value = system;
};
gitea_status_repo = {
type = "string";
value = "nix-packages";
emailresponsible = false;
};
gitea_repo_owner = {
type = "string";
value = "${info.head.repo.owner.login}";
emailresponsible = false;
};
gitea_repo_name = {
type = "string";
value = "${info.head.repo.name}";
emailresponsible = false;
};
2023-01-21 08:41:31 +00:00
};
};
}
2023-04-08 11:40:09 +00:00
)
prs
))
2023-01-21 08:41:31 +00:00
// {
2023-01-21 10:06:21 +00:00
"${system}-${version}" = {
2023-01-21 08:41:31 +00:00
enabled = 1;
hidden = false;
description = "nix-packages ${system}-${version}";
nixexprinput = "nix-packages";
nixexprpath = "hydra/default.nix";
2023-01-23 14:36:56 +00:00
checkinterval = 0;
2023-01-21 08:41:31 +00:00
schedulingshares = 100;
enableemail = false;
emailoverride = "";
keepnr = 1;
inputs = {
nix-packages = {
type = "git";
2023-04-08 10:31:26 +00:00
value = "https://git.chir.rs/darkkirb/nix-packages main";
2023-01-21 08:41:31 +00:00
emailresponsible = false;
};
nixpkgs = {
type = "git";
value = "https://github.com/NixOS/nixpkgs.git ${version}";
emailresponsible = false;
};
system = {
type = "string";
value = system;
};
2023-04-08 10:31:26 +00:00
gitea_status_repo = {
type = "string";
value = "nix-packages";
emailresponsible = false;
};
gitea_repo_owner = {
type = "string";
value = "darkkirb";
emailresponsible = false;
};
gitea_repo_name = {
type = "string";
2023-04-08 18:31:00 +00:00
value = "nix-packages";
2023-04-08 10:31:26 +00:00
emailresponsible = false;
};
2023-01-21 08:41:31 +00:00
};
};
};
2023-01-21 10:06:21 +00:00
concatAttrs = pkgs.lib.foldr (a: b: a // b) {};
2023-01-21 08:41:31 +00:00
2023-01-23 14:36:56 +00:00
jobsets =
2023-04-08 10:31:26 +00:00
concatAttrs (pkgs.lib.concatMap (system: map (version: mkJobsets system version) nixpkgs_version) systems);
2023-01-21 08:41:31 +00:00
in {jobsets = pkgs.writeText "jobsets.json" (builtins.toJSON jobsets);}