Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add overall required job #106

Merged
merged 10 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 12 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

inputs.haskellNix.url = "github:input-output-hk/haskell.nix";
inputs.nixpkgs.follows = "haskellNix/nixpkgs-unstable";
inputs.flake-utils.url = "github:hamishmack/flake-utils/hkm/nested-hydraJobs";
yvan-sraka marked this conversation as resolved.
Show resolved Hide resolved
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.iohk-nix.url = "github:input-output-hk/iohk-nix";

outputs = { self, nixpkgs, flake-utils, haskellNix, iohk-nix }:
Expand Down Expand Up @@ -47,7 +47,7 @@
"aarch64-linux"
"aarch64-darwin"
];
in flake-utils.lib.eachSystem supportedSystems (system:
in let flake-outputs = flake-utils.lib.eachSystem supportedSystems (system:
let
pkgs = import nixpkgs {
overlays = [haskellNix.overlay] ++ builtins.attrValues overlays;
Expand Down Expand Up @@ -165,7 +165,7 @@
inherit devShells;
hydraJobs = devShells // {
# *-dev sentinel job. Singals all -env have been built.
required = pkgs.runCommand "test-dependencies" {
required = pkgs.runCommand "required dependencies (${system})" {
_hydraAggregate = true;
constituents = map (name: "${system}.${name}-env") (builtins.attrNames devShellsWithEvalOnLinux);
} "touch $out";
Expand Down Expand Up @@ -211,6 +211,15 @@
packages.cabalProjectLocal.cross-js = (import ./quirks.nix { pkgs = js-pkgs; }).template;
packages.cabalProjectLocal.cross-windows = (import ./quirks.nix { pkgs = windows-pkgs; }).template;
});
# we use flake-outputs here to inject a required job that aggregates all required jobs.
in flake-outputs // {
hydraJobs = flake-outputs.hydraJobs // {
required = (import nixpkgs { system = "x86_64-linux"; }).runCommand "required dependencies" {
_hydraAggregate = true;
constituents = map (s: "${s}.required") supportedSystems;
} "touch $out";
};
};

# --- Flake Local Nix Configuration ----------------------------
nixConfig = {
Expand Down