diff options
author | github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> | 2022-10-02 00:04:43 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-02 00:04:43 +0000 |
commit | e879e7d54ee09c8bc8726d40ea2d31e8efdf93b5 (patch) | |
tree | 9662884a7112c2a23a1ed52e775896182f967c11 /lib | |
parent | aecf7c7bb9d978330ef40b0179fd25fb7f02d7b4 (diff) | |
parent | ae1d03834ebe4881dca31da399e277657ba33779 (diff) |
Merge master into staging-next
Diffstat (limited to 'lib')
-rw-r--r-- | lib/generators.nix | 6 | ||||
-rw-r--r-- | lib/modules.nix | 10 | ||||
-rw-r--r-- | lib/options.nix | 1 | ||||
-rw-r--r-- | lib/sources.nix | 1 | ||||
-rw-r--r-- | lib/tests/maintainers.nix | 1 | ||||
-rw-r--r-- | lib/types.nix | 2 |
6 files changed, 4 insertions, 17 deletions
diff --git a/lib/generators.nix b/lib/generators.nix index 431b93c4ebbc6..28b2e39bf6464 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 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; diff --git a/lib/options.nix b/lib/options.nix index dea85f0db04cb..40c1af667619f 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 343449d9a6037..cec395c9bb180 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 935d256d218d2..8a9a2b26efaf7 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 ed1d5f44064fe..9b2c5e846ad15 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 ; |