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 | |
parent | cc23141ba4281634d26a344b014018bbf2f84daa (diff) | |
parent | 3f0f0c74e9ab7ae45a23c66897d434f07e1b18a2 (diff) | |
download | nixlib-a1d50eecabed296b7d2671068d5ffcb8efa7d335.tar nixlib-a1d50eecabed296b7d2671068d5ffcb8efa7d335.tar.gz nixlib-a1d50eecabed296b7d2671068d5ffcb8efa7d335.tar.bz2 nixlib-a1d50eecabed296b7d2671068d5ffcb8efa7d335.tar.lz nixlib-a1d50eecabed296b7d2671068d5ffcb8efa7d335.tar.xz nixlib-a1d50eecabed296b7d2671068d5ffcb8efa7d335.tar.zst nixlib-a1d50eecabed296b7d2671068d5ffcb8efa7d335.zip |
Merge pull request #193132 from figsoda/clean-up
treewide: clean up
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 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 ; |