about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2022-03-12 00:10:12 +0000
committerGitHub <noreply@github.com>2022-03-12 00:10:12 +0000
commitb21a69401489149b41d14512487adc06a98bab44 (patch)
treebc880a5f24751da3673d1ed27d1c4da36b50579a /lib
parent4eba052b8d10601c6519faca564cdf6cc95e9ad9 (diff)
parent14260bb7ba68fd8c7cc088b71d9ae947bdba4c10 (diff)
Merge master into haskell-updates
Diffstat (limited to 'lib')
-rw-r--r--lib/modules.nix10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/modules.nix b/lib/modules.nix
index 79d54e4a53876..4c4d9f994dae7 100644
--- a/lib/modules.nix
+++ b/lib/modules.nix
@@ -761,13 +761,13 @@ rec {
       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 "listOf"  then types.listOf  (types.submodule options)
-        else if optionSetIn "nullOr"  then types.nullOr  (types.submodule options)
+        else if (tp.functor.wrapped.name or null) == "optionSet" then
+          if tp.name == "attrsOf" then types.attrsOf (types.submodule options)
+          else if tp.name == "listOf" then types.listOf  (types.submodule options)
+          else if tp.name == "nullOr" then types.nullOr  (types.submodule options)
+          else tp
         else tp;
     in
       if opt.type.getSubModules or null == null