aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/lib/modules.nix
diff options
context:
space:
mode:
Diffstat (limited to 'infra/libkookie/nixpkgs/lib/modules.nix')
-rw-r--r--infra/libkookie/nixpkgs/lib/modules.nix63
1 files changed, 52 insertions, 11 deletions
diff --git a/infra/libkookie/nixpkgs/lib/modules.nix b/infra/libkookie/nixpkgs/lib/modules.nix
index df3a2ad17e5f..3f2bfd478b0d 100644
--- a/infra/libkookie/nixpkgs/lib/modules.nix
+++ b/infra/libkookie/nixpkgs/lib/modules.nix
@@ -1,12 +1,53 @@
{ lib }:
-with lib.lists;
-with lib.strings;
-with lib.trivial;
-with lib.attrsets;
-with lib.options;
-with lib.debug;
-with lib.types;
+let
+ inherit (lib)
+ all
+ any
+ attrByPath
+ attrNames
+ catAttrs
+ concatLists
+ concatMap
+ count
+ elem
+ filter
+ findFirst
+ flip
+ foldl
+ foldl'
+ getAttrFromPath
+ head
+ id
+ imap1
+ isAttrs
+ isBool
+ isFunction
+ isString
+ length
+ mapAttrs
+ mapAttrsToList
+ mapAttrsRecursiveCond
+ min
+ optional
+ optionalAttrs
+ optionalString
+ recursiveUpdate
+ reverseList sort
+ setAttrByPath
+ toList
+ types
+ warn
+ ;
+ inherit (lib.options)
+ isOption
+ mkOption
+ showDefs
+ showFiles
+ showOption
+ unknownModule
+ ;
+in
rec {
@@ -224,7 +265,7 @@ rec {
if badAttrs != {} then
throw "Module `${key}' has an unsupported attribute `${head (attrNames badAttrs)}'. This is caused by introducing a top-level `config' or `options' attribute. Add configuration attributes immediately on the top level instead, or move all of them (namely: ${toString (attrNames badAttrs)}) into the explicit `config' attribute."
else
- { _file = m._file or file;
+ { _file = toString m._file or file;
key = toString m.key or key;
disabledModules = m.disabledModules or [];
imports = m.imports or [];
@@ -232,7 +273,7 @@ rec {
config = addFreeformType (addMeta (m.config or {}));
}
else
- { _file = m._file or file;
+ { _file = toString m._file or file;
key = toString m.key or key;
disabledModules = m.disabledModules or [];
imports = m.require or [] ++ m.imports or [];
@@ -616,7 +657,7 @@ rec {
fixupOptionType = loc: opt:
let
options = opt.options or
- (throw "Option `${showOption loc'}' has type optionSet but has no option attribute, in ${showFiles opt.declarations}.");
+ (throw "Option `${showOption loc}' has type optionSet but has no option attribute, in ${showFiles opt.declarations}.");
f = tp:
let optionSetIn = type: (tp.name == type) && (tp.functor.wrapped.name == "optionSet");
in
@@ -719,7 +760,7 @@ rec {
mkRemovedOptionModule [ "boot" "loader" "grub" "bootDevice" ] "<replacement instructions>"
- causes a warning if the user defines boot.loader.grub.bootDevice.
+ causes a assertion if the user defines boot.loader.grub.bootDevice.
replacementInstructions is a string that provides instructions on
how to achieve the same functionality without the removed option,