about summary refs log tree commit diff
path: root/lib/modules.nix
diff options
context:
space:
mode:
authordanbst <abcz2.uprola@gmail.com>2019-01-26 21:44:05 +0200
committerdanbst <abcz2.uprola@gmail.com>2019-01-31 00:41:10 +0200
commit27982b408e465554b8831f492362bc87ed0ec02a (patch)
tree9d91ef0747a5e1ed4a425e3e86a1b7172a8a16e4 /lib/modules.nix
parentaa2e63ce5ed6e24d73eaefe61489ece46f7460d7 (diff)
types.optionSet: deprecate and remove last usages
Diffstat (limited to 'lib/modules.nix')
-rw-r--r--lib/modules.nix19
1 files changed, 2 insertions, 17 deletions
diff --git a/lib/modules.nix b/lib/modules.nix
index cd031839e6499..5c9d66d8f97b9 100644
--- a/lib/modules.nix
+++ b/lib/modules.nix
@@ -364,7 +364,6 @@ rec {
         values = defs''';
         inherit (defs'') highestPrio;
       };
-
     defsFinal = defsFinal'.values;
 
     # Type-check the remaining definitions, and merge them.
@@ -477,22 +476,8 @@ rec {
      optionSet to options of type submodule.  FIXME: remove
      eventually. */
   fixupOptionType = loc: opt:
-    let
-      options = opt.options or
-        (throw "Option `${showOption loc'}' has type optionSet but has no option attribute, in ${showFiles opt.declarations}.");
-      f = tp:
-        let optionSetIn = type: (tp.name == type) && (tp.functor.wrapped.name == "optionSet");
-        in
-        if tp.name == "option set" || tp.name == "submodule" then
-          throw "The option ${showOption loc} uses submodules without a wrapping type, in ${showFiles opt.declarations}."
-        else if optionSetIn "attrsOf" then types.attrsOf (types.submodule options)
-        else if optionSetIn "loaOf"   then types.loaOf   (types.submodule options)
-        else if optionSetIn "listOf"  then types.listOf  (types.submodule options)
-        else if optionSetIn "nullOr"  then types.nullOr  (types.submodule options)
-        else tp;
-    in
-      if opt.type.getSubModules or null == null
-      then opt // { type = f (opt.type or types.unspecified); }
+    if opt.type.getSubModules or null == null
+      then opt // { type = opt.type or types.unspecified; }
       else opt // { type = opt.type.substSubModules opt.options; options = []; };