diff options
author | Antoine Eiche <lewo@abesis.fr> | 2021-07-10 16:05:25 +0200 |
---|---|---|
committer | Antoine Eiche <lewo@abesis.fr> | 2021-07-12 22:57:01 +0200 |
commit | a0f9688a31dd9f4b6f9d252ba06f8d1acef914af (patch) | |
tree | 94b7cd246366ce02b0b5fa677074d6547136f36c /.hydra | |
parent | a9f87ca461a1f0e23e85a1ba8c696672ed9e11e2 (diff) |
Switch CI to Nix flakes
We also move tests to Flakes.
This would allow users to submit PRs with a fork of nixpkgs when they
want to test nixpkgs PRs against SNM.
Diffstat (limited to '.hydra')
-rw-r--r-- | .hydra/declarative-jobsets.nix | 48 |
1 files changed, 14 insertions, 34 deletions
diff --git a/.hydra/declarative-jobsets.nix b/.hydra/declarative-jobsets.nix index 7d36ea6..2159de7 100644 --- a/.hydra/declarative-jobsets.nix +++ b/.hydra/declarative-jobsets.nix @@ -8,56 +8,26 @@ let { enabled = 1; hidden = false; description = "PR ${num}: ${info.title}"; - nixexprinput = "snm"; - nixexprpath = ".hydra/default.nix"; checkinterval = 30; schedulingshares = 20; enableemail = false; emailoverride = ""; keepnr = 1; - type = 0; - inputs = { - # This is only used to allow Niv to use pkgs.fetchzip which is - # required because of Hydra restricted evaluation mode. - nixpkgs = { - value = "https://github.com/NixOS/nixpkgs b6eefa48d8e10491e43c0c6155ac12b463f6fed3"; - type = "git"; - emailresponsible = false; - }; - snm = { - type = "git"; - value = "${info.target_repo_url} merge-requests/${info.iid}/head"; - emailresponsible = false; - }; - }; + type = 1; + flake = "gitlab:simple-nixos-mailserver/nixos-mailserver/merge-requests/${info.iid}/head"; } ) prs; mkJobset = branch: { description = "Build ${branch} branch of Simple NixOS MailServer"; checkinterval = "60"; enabled = "1"; - nixexprinput = "snm"; - nixexprpath = ".hydra/default.nix"; schedulingshares = 100; enableemail = false; emailoverride = ""; keepnr = 3; hidden = false; - type = 0; - inputs = { - # This is only used to allow Niv to use pkgs.fetchzip which is - # required because of Hydra restricted evaluation mode. - nixpkgs = { - value = "https://github.com/NixOS/nixpkgs b6eefa48d8e10491e43c0c6155ac12b463f6fed3"; - type = "git"; - emailresponsible = false; - }; - snm = { - value = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver ${branch}"; - type = "git"; - emailresponsible = false; - }; - }; + type = 1; + flake = "gitlab:simple-nixos-mailserver/nixos-mailserver/${branch}"; }; desc = prJobsets // { @@ -66,10 +36,20 @@ let "nixos-21.05" = mkJobset "nixos-21.05"; }; + 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 ''; } |