eachSystem: special case hydraJobs to match hydra convention. (#45)

This commit is contained in:
Jean-Baptiste Giraudeau 2021-10-21 23:17:30 +02:00 committed by GitHub
parent 7e5bf3925f
commit c91f3de5ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,8 +60,9 @@ let
# eachSystem using defaultSystems
eachDefaultSystem = eachSystem defaultSystems;
# Builds a map from <attr>=value to <attr>.<system>=value for each system.
#
# Builds a map from <attr>=value to <attr>.<system>=value for each system,
# except for the `hydraJobs` attribute, where it maps the inner attributes,
# from hydraJobs.<attr>=value to hydraJobs.<attr>.<system>=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