summary refs log tree commit diff
path: root/lib
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
parentaa2e63ce5ed6e24d73eaefe61489ece46f7460d7 (diff)
downloadnixpkgs-27982b408e465554b8831f492362bc87ed0ec02a.tar
nixpkgs-27982b408e465554b8831f492362bc87ed0ec02a.tar.gz
nixpkgs-27982b408e465554b8831f492362bc87ed0ec02a.tar.bz2
nixpkgs-27982b408e465554b8831f492362bc87ed0ec02a.tar.lz
nixpkgs-27982b408e465554b8831f492362bc87ed0ec02a.tar.xz
nixpkgs-27982b408e465554b8831f492362bc87ed0ec02a.tar.zst
nixpkgs-27982b408e465554b8831f492362bc87ed0ec02a.zip
types.optionSet: deprecate and remove last usages
Diffstat (limited to 'lib')
-rw-r--r--lib/modules.nix19
-rw-r--r--lib/options.nix2
-rw-r--r--lib/types.nix5
3 files changed, 3 insertions, 23 deletions
diff --git a/lib/modules.nix b/lib/modules.nix
index cd031839e64..5c9d66d8f97 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 = []; };
 
 
diff --git a/lib/options.nix b/lib/options.nix
index 791930eafbd..5cea99067aa 100644
--- a/lib/options.nix
+++ b/lib/options.nix
@@ -48,8 +48,6 @@ rec {
     visible ? null,
     # Whether the option can be set only once
     readOnly ? null,
-    # Obsolete, used by types.optionSet.
-    options ? null
     } @ attrs:
     attrs // { _type = "option"; };
 
diff --git a/lib/types.nix b/lib/types.nix
index 2ec8fd987c1..7a88e1b9e36 100644
--- a/lib/types.nix
+++ b/lib/types.nix
@@ -469,10 +469,7 @@ rec {
     # Obsolete alternative to configOf.  It takes its option
     # declarations from the ‘options’ attribute of containing option
     # declaration.
-    optionSet = mkOptionType {
-      name = builtins.trace "types.optionSet is deprecated; use types.submodule instead" "optionSet";
-      description = "option set";
-    };
+    optionSet = builtins.throw "types.optionSet is deprecated; use types.submodule instead" "optionSet";
 
     # Augment the given type with an additional type check function.
     addCheck = elemType: check: elemType // { check = x: elemType.check x && check x; };