maybe set up hydra
https://discourse.nixos.org/t/hydra-how-to-use-github-pulls-with-a-flake/29418 Signed-off-by: ahuston-0 <aliceghuston@gmail.com>
This commit is contained in:
parent
b059813b8b
commit
3955dd70aa
48
.hydra/jobsets.nix
Normal file
48
.hydra/jobsets.nix
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
{ 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:ahuston-0/nix-dotfiles-hydra/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:ahuston-0/nix-dotfiles-hydra/${branch}";
|
||||||
|
};
|
||||||
|
|
||||||
|
desc = prJobsets // { "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
|
||||||
|
'';
|
||||||
|
}
|
30
.hydra/spec.json
Normal file
30
.hydra/spec.json
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"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://github.com/ahuston-0/nix-dotfiles-hydra main",
|
||||||
|
"type": "git",
|
||||||
|
"emailresponsible": false
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"value": "https://github.com/NixOS/nixpkgs nixos-unstable-small",
|
||||||
|
"type": "git",
|
||||||
|
"emailresponsible": false
|
||||||
|
},
|
||||||
|
"pulls": {
|
||||||
|
"type": "githubpulls",
|
||||||
|
"value": "ahuston-0 nix-dotfiles-hydra",
|
||||||
|
"emailresponsible": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user