Skip to content

Commit

Permalink
prepare for garnix
Browse files Browse the repository at this point in the history
Garnix does not build the `hydraJobs` output
so move them all into the `checks` output,
adhering to the flake output schema
because garnix does not build nested attrsets.
  • Loading branch information
dermetfan committed Jan 14, 2025
1 parent a5cd0b8 commit 9b4768e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
30 changes: 28 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,14 @@
description = "Cardano Node";

nixConfig = {
extra-substituters = [ "https://cache.iog.io" ];
extra-trusted-public-keys = [ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ];
extra-substituters = [
"https://cache.iog.io"
"https://cache.garnix.io"
];
extra-trusted-public-keys = [
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
];
};

inputs = {
Expand Down Expand Up @@ -393,6 +399,26 @@
}) required;
});

checks = let
# https://github.com/numtide/flake-utils/issues/121#issuecomment-2589899217
recurseIntoDeepAttrs = attrs:
lib.recurseIntoAttrs (lib.mapAttrs (_: v:
if builtins.typeOf v == "set" && !lib.isDerivation v
then recurseIntoDeepAttrs v
else v
) attrs);
in lib.genAttrs supportedSystems (system:
utils.lib.flattenTree (recurseIntoDeepAttrs flake.ciJobs.${system})
// {
inherit (
let pkgs = self.legacyPackages.${system}; in
pkgs.callPackages iohkNix.utils.ciJobsAggregates {
ciJobs = lib.mapAttrs (_: lib.getAttr "required") flake.ciJobs.${system};
}
) required;
}
);

# allows precise paths (avoid fallbacks) with nix build/eval:
outputs = self;

Expand Down
3 changes: 3 additions & 0 deletions garnix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
builds:
include:
- 'checks.*.*'

0 comments on commit 9b4768e

Please sign in to comment.