summary refs log tree commit diff
path: root/lib/modules.nix
diff options
context:
space:
mode:
authorfigsoda <figsoda@pm.me>2022-09-26 22:05:09 -0400
committerfigsoda <figsoda@pm.me>2022-09-26 22:18:55 -0400
commit05fc3747c9c5c96bd570e078fde5e48cac8ffd3c (patch)
treede1fb70a0efa98f891020610e2c1272315b4c5ea /lib/modules.nix
parent07b3a5a0ddb569cf903101db3650c0a645b1426d (diff)
downloadnixpkgs-05fc3747c9c5c96bd570e078fde5e48cac8ffd3c.tar
nixpkgs-05fc3747c9c5c96bd570e078fde5e48cac8ffd3c.tar.gz
nixpkgs-05fc3747c9c5c96bd570e078fde5e48cac8ffd3c.tar.bz2
nixpkgs-05fc3747c9c5c96bd570e078fde5e48cac8ffd3c.tar.lz
nixpkgs-05fc3747c9c5c96bd570e078fde5e48cac8ffd3c.tar.xz
nixpkgs-05fc3747c9c5c96bd570e078fde5e48cac8ffd3c.tar.zst
nixpkgs-05fc3747c9c5c96bd570e078fde5e48cac8ffd3c.zip
lib/modules.nix: remove unused bindings
Diffstat (limited to 'lib/modules.nix')
-rw-r--r--lib/modules.nix10
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/modules.nix b/lib/modules.nix
index b6751d17f8f..c2150da4fd7 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:
@@ -603,7 +600,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${
@@ -651,11 +647,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;