···
19
-
libAttr = lib.attrsets;
···
mkLines = if listsAsDuplicateKeys
then k: v: map (mkLine k) (if isList v then v else [v])
else k: v: [ (mkLine k v) ];
146
-
in attrs: concatStrings (concatLists (libAttr.mapAttrsToList mkLines attrs));
144
+
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:
181
-
(libAttr.mapAttrsToList mapFn attrs);
179
+
(mapAttrsToList mapFn attrs);
mkSection = sectName: sectValues: ''
[${mkSectionName sectName}]
'' + toKeyValue { inherit mkKeyValue listsAsDuplicateKeys; } sectValues;
···
else if isFunction v then
let fna = functionArgs v;
402
-
showFnas = concatStringsSep ", " (libAttr.mapAttrsToList
400
+
showFnas = concatStringsSep ", " (mapAttrsToList
(name: hasDefVal: if hasDefVal then name + "?" else name)
in if fna == {} then "<function>"
···
else if v ? type && v.type == "derivation" then
"<derivation ${v.name or "???"}>"
415
-
+ concatStringsSep introSpace (libAttr.mapAttrsToList
413
+
+ concatStringsSep introSpace (mapAttrsToList
"${escapeNixIdentifier name} = ${
addErrorContext "while evaluating an attribute `${name}`"
···
577
-
else if libAttr.isDerivation v then
575
+
else if isDerivation v then
"{${introSpace}${concatItems (