From 2952d7d114954694e0d0856df2c51d09b9f1bda7 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Wed, 5 Jun 2013 11:20:59 -0400 Subject: [PATCH] Merge submodule extraArgs and individualExtraArgs Signed-off-by: Shea Levy --- pkgs/lib/options.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/lib/options.nix b/pkgs/lib/options.nix index 4e939047070..3a8cc0006ef 100644 --- a/pkgs/lib/options.nix +++ b/pkgs/lib/options.nix @@ -165,6 +165,14 @@ rec { // optionalAttrs (opt1 ? extraConfigs || opt2 ? extraConfigs) { extraConfigs = opt1.extraConfigs or [] ++ opt2.extraConfigs or []; } + // optionalAttrs (opt1 ? extraArgs || opt2 ? extraArgs) { + extraArgs = opt1.extraArgs or {} // opt2.extraArgs or {}; + } + // optionalAttrs (opt1 ? individualExtraArgs || opt2 ? individualExtraArgs) { + individualExtraArgs = zipAttrsWith (name: values: + if length values == 1 then head values else (head values // (head (tail values))) + ) [ (opt1.individualExtraArgs or {}) (opt2.individualExtraArgs or {}) ]; + } )) {} opts;