3
0
Fork 0
forked from mirrors/nixpkgs

simplified isOption reusing typeOf

svn path=/nixpkgs/trunk/; revision=13119
This commit is contained in:
Marc Weber 2008-10-26 17:44:23 +00:00
parent 2cb8e66b8f
commit a9b19788fb

View file

@ -347,12 +347,9 @@ rec {
mkOption = attrs: attrs // {_type = "option";};
typeOf = x: if x ? _type then x._type else "";
typeOf = x: if (__isAttrs x && x ? _type) then x._type else "";
isOption = attrs:
__isAttrs attrs
&& attrs ? _type
&& attrs._type == "option";
isOption = attrs: (typeOf attrs) == "option";
addDefaultOptionValues = defs: opts: opts //
builtins.listToAttrs (map (defName: