hydra: wip init
Some checks failed
/ test (push) Has been cancelled

This commit is contained in:
Christoph Hollizeck 2024-12-28 12:48:12 +01:00
parent d02e25eb96
commit e7066d45a4
Signed by: Daholli
GPG key ID: 249300664F2AF2C7
2 changed files with 80 additions and 0 deletions

55
.hydra/jobsets.nix Normal file
View file

@ -0,0 +1,55 @@
{
nixpkgs,
# pulls,
...
}:
let
pkgs = import nixpkgs { };
# prs = builtins.fromJSON (builtins.readFile pulls);
# prJobsets = pkgs.lib.mapAttrs (num: info: {
# enabled = 1;
# hidden = false;
# description = "PR ${num}: ${info.title}";
# checkinterval = 60;
# schedulingshares = 20;
# enableemail = false;
# emailoverride = "";
# keepnr = 1;
# type = 1;
# flake = "github:shawn8901/nix-configuration/pull/${num}/head";
# }) prs;
mkFlakeJobset = branch: {
description = "Build ${branch}";
checkinterval = "3600";
enabled = "1";
schedulingshares = 100;
enableemail = false;
emailoverride = "";
keepnr = 3;
hidden = false;
type = 1;
flake = "github:shawn8901/nix-configuration/${branch}";
};
desc = {
"main" = mkFlakeJobset "main";
};
log = {
# pulls = prs;
jobsets = desc;
};
in
{
jobsets = pkgs.runCommand "spec-jobsets.json" { } ''
cat >$out <<EOF
${builtins.toJSON desc}
EOF
# This is to get nice .jobsets build logs on Hydra
cat >tmp <<EOF
${builtins.toJSON log}
EOF
${pkgs.jq}/bin/jq . tmp
'';
}

25
.hydra/spec.json Normal file
View file

@ -0,0 +1,25 @@
{
"enabled": 1,
"hidden": false,
"description": "system flake",
"nixexprinput": "nixexpr",
"nixexprpath": ".hydra/jobsets.nix",
"checkinterval": 3600,
"schedulingshares": 100,
"enableemail": false,
"emailoverride": "",
"keepnr": 3,
"type": 0,
"inputs": {
"nixexpr": {
"value": "https://git.christophhollizeck.dev/Daholli/nixos-config.git main",
"type": "git",
"emailresponsible": false
},
"nixpkgs": {
"value": "https://github.com/NixOS/nixpkgs unstable",
"type": "git",
"emailresponsible": false
}
}
}