lib/generators: explicitly import names from `lib.attrsets`

Everything used was already imported.

Changed files
+5 -7
lib
+5 -7
lib/generators.nix
···
{ lib }:
with (lib).trivial;
let
-
libAttr = lib.attrsets;
-
inherit (builtins)
addErrorContext
attrNames
···
mkLines = if listsAsDuplicateKeys
then k: v: map (mkLine k) (if isList v then v else [v])
else k: v: [ (mkLine k v) ];
-
in attrs: concatStrings (concatLists (libAttr.mapAttrsToList mkLines attrs));
+
in attrs: concatStrings (concatLists (mapAttrsToList mkLines attrs));
/* Generate an INI-style config file from an
···
# map function to string for each key val
mapAttrsToStringsSep = sep: mapFn: attrs:
concatStringsSep sep
-
(libAttr.mapAttrsToList mapFn attrs);
+
(mapAttrsToList mapFn attrs);
mkSection = sectName: sectValues: ''
[${mkSectionName sectName}]
'' + toKeyValue { inherit mkKeyValue listsAsDuplicateKeys; } sectValues;
···
+ outroSpace + "]"
else if isFunction v then
let fna = functionArgs v;
-
showFnas = concatStringsSep ", " (libAttr.mapAttrsToList
+
showFnas = concatStringsSep ", " (mapAttrsToList
(name: hasDefVal: if hasDefVal then name + "?" else name)
fna);
in if fna == {} then "<function>"
···
else if v ? type && v.type == "derivation" then
"<derivation ${v.name or "???"}>"
else "{" + introSpace
-
+ concatStringsSep introSpace (libAttr.mapAttrsToList
+
+ concatStringsSep introSpace (mapAttrsToList
(name: value:
"${escapeNixIdentifier name} = ${
addErrorContext "while evaluating an attribute `${name}`"
···
"(${v.expr})"
else if v == { } then
"{}"
-
else if libAttr.isDerivation v then
+
else if isDerivation v then
''"${toString v}"''
else
"{${introSpace}${concatItems (