From c9dad37f01d138e74d0e72050db6eb6f7d074948 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 28 Oct 2013 22:09:16 +0100 Subject: [PATCH] Remove obsolete function addDefaultOptionValues --- lib/options.nix | 26 ------------------- .../web-servers/apache-httpd/default.nix | 6 +++-- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/lib/options.nix b/lib/options.nix index 66957bc7f15..2b211478765 100644 --- a/lib/options.nix +++ b/lib/options.nix @@ -30,31 +30,6 @@ rec { type = lib.types.bool; }; - # !!! This function will be removed because this can be done with the - # multiple option declarations. - addDefaultOptionValues = defs: opts: opts // - builtins.listToAttrs (map (defName: - { name = defName; - value = - let - defValue = builtins.getAttr defName defs; - optValue = builtins.getAttr defName opts; - in - if isOption defValue - then - # `defValue' is an option. - if hasAttr defName opts - then builtins.getAttr defName opts - else defValue.default - else - # `defValue' is an attribute set containing options. - # So recurse. - if hasAttr defName opts && isAttrs optValue - then addDefaultOptionValues defValue optValue - else addDefaultOptionValues defValue {}; - } - ) (attrNames defs)); - mergeDefaultOption = args: list: if length list == 1 then head list else if all builtins.isFunction list then x: mergeDefaultOption args (map (f: f x) list) @@ -65,7 +40,6 @@ rec { else if all builtins.isInt list && all (x: x == head list) list then head list else throw "Cannot merge definitions of `${showOption args.prefix}' given in ${showFiles args.files}."; - /* Obsolete, will remove soon. Specify an option type or apply function instead. */ mergeTypedOption = typeName: predicate: merge: args: list: diff --git a/nixos/modules/services/web-servers/apache-httpd/default.nix b/nixos/modules/services/web-servers/apache-httpd/default.nix index 7688b04f1c1..4b0a5d6d363 100644 --- a/nixos/modules/services/web-servers/apache-httpd/default.nix +++ b/nixos/modules/services/web-servers/apache-httpd/default.nix @@ -47,8 +47,10 @@ let svcFunction = if svc ? function then svc.function else import "${./.}/${if svc ? serviceType then svc.serviceType else svc.serviceName}.nix"; - config = addDefaultOptionValues res.options - (if svc ? config then svc.config else svc); + config = (evalModules + { modules = [ { options = res.options; config = svc.config or svc; } ]; + check = false; + }).config; defaults = { extraConfig = ""; extraModules = [];