aboutsummaryrefslogtreecommitdiff
path: root/doc/manual/utils.nix
diff options
context:
space:
mode:
Diffstat (limited to 'doc/manual/utils.nix')
-rw-r--r--doc/manual/utils.nix9
1 files changed, 6 insertions, 3 deletions
diff --git a/doc/manual/utils.nix b/doc/manual/utils.nix
index 5eacce0dd..82544935a 100644
--- a/doc/manual/utils.nix
+++ b/doc/manual/utils.nix
@@ -5,6 +5,9 @@ rec {
concatStrings = concatStringsSep "";
+ attrsToList = a:
+ map (name: { inherit name; value = a.${name}; }) (builtins.attrNames a);
+
replaceStringsRec = from: to: string:
# recursively replace occurrences of `from` with `to` within `string`
# example:
@@ -74,10 +77,10 @@ rec {
if aliases == [] then "" else
"**Deprecated alias:** ${(concatStringsSep ", " (map (s: "`${s}`") aliases))}";
- indent = prefix: s:
- concatStringsSep "\n" (map (x: if x == "" then x else "${prefix}${x}") (splitLines s));
-
in result;
+ indent = prefix: s:
+ concatStringsSep "\n" (map (x: if x == "" then x else "${prefix}${x}") (splitLines s));
+
showSettings = args: settingsInfo: concatStrings (attrValues (mapAttrs (showSetting args) settingsInfo));
}