summary refs log tree commit diff
path: root/lib/options.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-28 22:09:16 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-28 22:45:58 +0100
commitc9dad37f01d138e74d0e72050db6eb6f7d074948 (patch)
tree2c6a45601b2d638d721f1f0551310296922a97c5 /lib/options.nix
parentf8a9eb9f00ae84bc2daef9b78d2bd5153ffe81b6 (diff)
downloadnixlib-c9dad37f01d138e74d0e72050db6eb6f7d074948.tar
nixlib-c9dad37f01d138e74d0e72050db6eb6f7d074948.tar.gz
nixlib-c9dad37f01d138e74d0e72050db6eb6f7d074948.tar.bz2
nixlib-c9dad37f01d138e74d0e72050db6eb6f7d074948.tar.lz
nixlib-c9dad37f01d138e74d0e72050db6eb6f7d074948.tar.xz
nixlib-c9dad37f01d138e74d0e72050db6eb6f7d074948.tar.zst
nixlib-c9dad37f01d138e74d0e72050db6eb6f7d074948.zip
Remove obsolete function addDefaultOptionValues
Diffstat (limited to 'lib/options.nix')
-rw-r--r--lib/options.nix26
1 files changed, 0 insertions, 26 deletions
diff --git a/lib/options.nix b/lib/options.nix
index 66957bc7f155..2b211478765d 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: