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
1 changed files with 6 additions and 3 deletions

View File

@ -60,8 +60,9 @@ let
# eachSystem using defaultSystems # eachSystem using defaultSystems
eachDefaultSystem = eachSystem 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: eachSystem = systems: f:
let let
@ -71,7 +72,9 @@ let
op = attrs: key: op = attrs: key:
attrs // 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 in