diff options
author | figsoda <figsoda@pm.me> | 2022-10-01 17:03:11 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-01 17:03:11 -0400 |
commit | a1d50eecabed296b7d2671068d5ffcb8efa7d335 (patch) | |
tree | 6ef9b21710e8f5d2ca7946efa46330b38938b0ef /lib/modules.nix | |
parent | cc23141ba4281634d26a344b014018bbf2f84daa (diff) | |
parent | 3f0f0c74e9ab7ae45a23c66897d434f07e1b18a2 (diff) |
Merge pull request #193132 from figsoda/clean-up
treewide: clean up
Diffstat (limited to 'lib/modules.nix')
-rw-r--r-- | lib/modules.nix | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/modules.nix b/lib/modules.nix index 46e22088a204a..a7fbec93a2f51 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -12,7 +12,6 @@ let concatStringsSep elem filter - findFirst foldl' getAttrFromPath head @@ -34,7 +33,6 @@ let recursiveUpdate reverseList sort setAttrByPath - toList types warnIf zipAttrsWith @@ -46,7 +44,6 @@ let showFiles showOption unknownModule - literalExpression ; showDeclPrefix = loc: decl: prefix: @@ -604,7 +601,6 @@ rec { } else let - firstNonOption = findFirst (m: !isOption m.options) "" decls; nonOptions = filter (m: !isOption m.options) decls; in throw "The option `${showOption loc}' in module `${(lib.head optionDecls)._file}' would be a parent of the following options, but its type `${(lib.head optionDecls).options.type.description or "<no description>"}' does not support nested options.\n${ @@ -652,11 +648,7 @@ rec { 'opts' is a list of modules. Each module has an options attribute which correspond to the definition of 'loc' in 'opt.file'. */ mergeOptionDecls = - let - coerceOption = file: opt: - if isFunction opt then setDefaultModuleLocation file opt - else setDefaultModuleLocation file { options = opt; }; - in loc: opts: + loc: opts: foldl' (res: opt: let t = res.type; t' = opt.options.type; |