From 6805151b6c88e9e7406958bf9b04ad0879a7af76 Mon Sep 17 00:00:00 2001 From: Robin Stumm Date: Tue, 14 Jan 2025 22:59:17 +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 | 13 ++++++++++++- garnix.yaml | 3 +++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 garnix.yaml diff --git a/flake.nix b/flake.nix index 99a1353..ca24efe 100644 --- a/flake.nix +++ b/flake.nix @@ -59,7 +59,7 @@ } ); in - lib.recursiveUpdate flake rec { + lib.recursiveUpdate (removeAttrs flake ["checks"]) rec { project = cabalProject; # add a required job, that's basically all hydraJobs. hydraJobs = flake.hydraJobs @@ -67,15 +67,26 @@ # This ensure hydra send a status for the required job (even if no change other than commit hash) revision = nixpkgs.writeText "revision" (inputs.self.rev or "dirty"); }; + 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 inputs.flake-utils.lib.flattenTree (recurseIntoDeepAttrs flake.hydraJobs); } ); nixConfig = { 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=" ]; allow-import-from-derivation = true; }; 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.*.*'