diff options
author | Nicolas B. Pierron <nicolas.b.pierron@gmail.com> | 2015-03-12 22:38:51 +0100 |
---|---|---|
committer | Nicolas B. Pierron <nicolas.b.pierron@gmail.com> | 2015-03-12 23:42:58 +0100 |
commit | dd4f5f6b789c7fb2cac45cb8024e87bdb13c9740 (patch) | |
tree | 850f1dd16859131aa088b8b08288b6076161bedc /lib/modules.nix | |
parent | 83dc60456e44082b4f13c2be19c5e9fbcfd57f74 (diff) |
Rename mergeDefinitions internal steps to functions which are independent of each others.
Diffstat (limited to 'lib/modules.nix')
-rw-r--r-- | lib/modules.nix | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/modules.nix b/lib/modules.nix index ca88b28a7791..ad573da990f4 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -274,20 +274,21 @@ rec { defsFinal = let # Process mkMerge and mkIf properties - discharged = concatMap (m: + processIfAndMerge = defs: concatMap (m: map (value: { inherit (m) file; inherit value; }) (dischargeProperties m.value) ) defs; # Process mkOverride properties - overridden = filterOverrides discharged; + processOverride = defs: filterOverrides defs; # Sort mkOrder properties - sorted = + processOrder = defs: # Avoid sorting if we don't have to. - if any (def: def.value._type or "" == "order") overridden - then sortProperties overridden - else overridden; - in sorted; + if any (def: def.value._type or "" == "order") defs + then sortProperties defs + else defs; + in + processOrder (processOverride (processIfAndMerge defs)); # Type-check the remaining definitions, and merge them mergedValue = fold (def: res: |