From bf8c03e3f75efb1b24837cb80e5ded4b8cfae602 Mon Sep 17 00:00:00 2001 From: Robin Stumm Date: Tue, 14 Jan 2025 22:35:41 +0100 Subject: [PATCH] prepare for garnix 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. --- flake.nix | 19 +++++++++++++++++-- garnix.yaml | 3 +++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 garnix.yaml diff --git a/flake.nix b/flake.nix index 3950ee0..55920b0 100644 --- a/flake.nix +++ b/flake.nix @@ -66,10 +66,23 @@ # This is not ideal, it means this flake will not evaluate properly on # anything but linux :-/ However, CI requires a top-level required job, # for now. And not one per system. - in pkgs.lib.recursiveUpdate flake { + in pkgs.lib.recursiveUpdate (removeAttrs flake ["checks"]) { # add a required job, that's basically all hydraJobs. hydraJobs = pkgs.callPackages inputs.iohkNix.utils.ciJobsAggregates { ciJobs = flake.hydraJobs; }; + + checks = let + # https://github.com/numtide/flake-utils/issues/121#issuecomment-2589899217 + recurseIntoDeepAttrs = attrs: + pkgs.lib.recurseIntoAttrs (pkgs.lib.mapAttrs (_: v: + if builtins.typeOf v == "set" && !pkgs.lib.isDerivation v + then recurseIntoDeepAttrs v + else v + ) attrs); + in pkgs.lib.genAttrs supportedSystems (system: + inputs.flake-utils.lib.flattenTree (recurseIntoDeepAttrs flake.hydraJobs.${system}) + // pkgs.callPackages inputs.iohkNix.utils.ciJobsAggregates { ciJobs = flake.hydraJobs.${system}; } + ); }; nixConfig = { @@ -78,11 +91,13 @@ # drop this, once we stop needing it; when we have stable aarch64-darwin # builds "https://cache.zw3rk.com" + "https://cache.garnix.io" ]; extra-trusted-public-keys = [ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" "loony-tools:pr9m4BkM/5/eSTZlkQyRt57Jz7OMBxNSUiMC4FkcNfk=" + "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" ]; allow-import-from-derivation = true; }; -} \ No newline at end of file +} diff --git a/garnix.yaml b/garnix.yaml new file mode 100644 index 0000000..da969a1 --- /dev/null +++ b/garnix.yaml @@ -0,0 +1,3 @@ +builds: + include: + - 'checks.*.*'