From c91f3de5adaf1de973b797ef7485e441a65b8935 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Giraudeau Date: Thu, 21 Oct 2021 23:17:30 +0200 Subject: [PATCH] eachSystem: special case hydraJobs to match hydra convention. (#45) --- default.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/default.nix b/default.nix index fdce02f..f8b8300 100644 --- a/default.nix +++ b/default.nix @@ -60,8 +60,9 @@ let # eachSystem using defaultSystems eachDefaultSystem = eachSystem defaultSystems; - # Builds a map from =value to .=value for each system. - # + # Builds a map from =value to .=value for each system, + # except for the `hydraJobs` attribute, where it maps the inner attributes, + # from hydraJobs.=value to hydraJobs..=value. # eachSystem = systems: f: let @@ -71,7 +72,9 @@ let op = attrs: key: attrs // { - ${key} = (attrs.${key} or { }) // { ${system} = ret.${key}; }; + ${key} = (attrs.${key} or { }) // (if key == "hydraJobs" + then builtins.mapAttrs (name: value: (attrs.hydraJobs.${name} or { }) // { ${system} = value; }) ret.hydraJobs + else { ${system} = ret.${key}; }); } ; in