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-10-02 00:04:43 +0000
committerGitHub <noreply@github.com>2022-10-02 00:04:43 +0000
commite879e7d54ee09c8bc8726d40ea2d31e8efdf93b5 (patch)
tree9662884a7112c2a23a1ed52e775896182f967c11 /lib
parentaecf7c7bb9d978330ef40b0179fd25fb7f02d7b4 (diff)
parentae1d03834ebe4881dca31da399e277657ba33779 (diff)
downloadnixlib-e879e7d54ee09c8bc8726d40ea2d31e8efdf93b5.tar
nixlib-e879e7d54ee09c8bc8726d40ea2d31e8efdf93b5.tar.gz
nixlib-e879e7d54ee09c8bc8726d40ea2d31e8efdf93b5.tar.bz2
nixlib-e879e7d54ee09c8bc8726d40ea2d31e8efdf93b5.tar.lz
nixlib-e879e7d54ee09c8bc8726d40ea2d31e8efdf93b5.tar.xz
nixlib-e879e7d54ee09c8bc8726d40ea2d31e8efdf93b5.tar.zst
nixlib-e879e7d54ee09c8bc8726d40ea2d31e8efdf93b5.zip
Merge master into staging-next
Diffstat (limited to 'lib')
-rw-r--r--lib/generators.nix6
-rw-r--r--lib/modules.nix10
-rw-r--r--lib/options.nix1
-rw-r--r--lib/sources.nix1
-rw-r--r--lib/tests/maintainers.nix1
-rw-r--r--lib/types.nix2
6 files changed, 4 insertions, 17 deletions
diff --git a/lib/generators.nix b/lib/generators.nix
index 431b93c4ebbc..28b2e39bf646 100644
--- a/lib/generators.nix
+++ b/lib/generators.nix
@@ -240,10 +240,10 @@ rec {
     * to implicit typing rules, so it should work with older
     * parsers as well.
     */
-  toYAML = {}@args: toJSON args;
+  toYAML = toJSON;
 
   withRecursion =
-    args@{
+    {
       /* If this option is not null, the given value will stop evaluating at a certain depth */
       depthLimit
       /* If this option is true, an error will be thrown, if a certain given depth is exceeded */
@@ -287,7 +287,7 @@ rec {
     allowPrettyValues ? false,
     /* If this option is true, the output is indented with newlines for attribute sets and lists */
     multiline ? true
-  }@args:
+  }:
     let
     go = indent: v: with builtins;
     let     isPath   = v: typeOf v == "path";
diff --git a/lib/modules.nix b/lib/modules.nix
index 46e22088a204..a7fbec93a2f5 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;
diff --git a/lib/options.nix b/lib/options.nix
index dea85f0db04c..40c1af667619 100644
--- a/lib/options.nix
+++ b/lib/options.nix
@@ -8,7 +8,6 @@ let
     concatLists
     concatMap
     concatMapStringsSep
-    elemAt
     filter
     foldl'
     head
diff --git a/lib/sources.nix b/lib/sources.nix
index 343449d9a603..cec395c9bb18 100644
--- a/lib/sources.nix
+++ b/lib/sources.nix
@@ -4,7 +4,6 @@
 # Tested in lib/tests/sources.sh
 let
   inherit (builtins)
-    hasContext
     match
     readDir
     split
diff --git a/lib/tests/maintainers.nix b/lib/tests/maintainers.nix
index 935d256d218d..8a9a2b26efaf 100644
--- a/lib/tests/maintainers.nix
+++ b/lib/tests/maintainers.nix
@@ -6,7 +6,6 @@
 }:
 
 let
-  inherit (lib) types;
   checkMaintainer = handle: uncheckedAttrs:
   let
       prefix = [ "lib" "maintainers" handle ];
diff --git a/lib/types.nix b/lib/types.nix
index ed1d5f44064f..9b2c5e846ad1 100644
--- a/lib/types.nix
+++ b/lib/types.nix
@@ -6,7 +6,6 @@ let
   inherit (lib)
     elem
     flip
-    functionArgs
     isAttrs
     isBool
     isDerivation
@@ -16,7 +15,6 @@ let
     isList
     isString
     isStorePath
-    setFunctionArgs
     toDerivation
     toList
     ;