summary refs log tree commit diff
path: root/lib/generators.nix
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2018-03-26 17:28:17 +0200
committerProfpatsch <mail@profpatsch.de>2018-03-29 16:53:06 +0200
commita7e45fdd8eddca06c2c5db013fe8f9dc4475e1b5 (patch)
tree3337b04a62ca8ce19971251f0b2a891202e75468 /lib/generators.nix
parent219ba583b269b1adc8f2bf57604f9204acb2cf56 (diff)
downloadnixpkgs-a7e45fdd8eddca06c2c5db013fe8f9dc4475e1b5.tar
nixpkgs-a7e45fdd8eddca06c2c5db013fe8f9dc4475e1b5.tar.gz
nixpkgs-a7e45fdd8eddca06c2c5db013fe8f9dc4475e1b5.tar.bz2
nixpkgs-a7e45fdd8eddca06c2c5db013fe8f9dc4475e1b5.tar.lz
nixpkgs-a7e45fdd8eddca06c2c5db013fe8f9dc4475e1b5.tar.xz
nixpkgs-a7e45fdd8eddca06c2c5db013fe8f9dc4475e1b5.tar.zst
nixpkgs-a7e45fdd8eddca06c2c5db013fe8f9dc4475e1b5.zip
lib/generators: improve documentation a bit
Diffstat (limited to 'lib/generators.nix')
-rw-r--r--lib/generators.nix11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/generators.nix b/lib/generators.nix
index 64399ddd50a..6adf0c2afbc 100644
--- a/lib/generators.nix
+++ b/lib/generators.nix
@@ -4,6 +4,12 @@
  * They all follow a similar interface:
  * generator { config-attrs } data
  *
+ * `config-attrs` are “holes” in the generators
+ * with sensible default implementations that
+ * can be overwritten. The default implementations
+ * are mostly generators themselves, called with
+ * their respective default values; they can be reused.
+ *
  * Tests can be found in ./tests.nix
  * Documentation in the manual, #sec-generators
  */
@@ -20,6 +26,8 @@ in
 
 rec {
 
+  ## -- HELPER FUNCTIONS & DEFAULTS --
+
   /* Generate a line of key k and value v, separated by
    * character sep. If sep appears in k, it is escaped.
    * Helper for synaxes with different separators.
@@ -35,6 +43,9 @@ rec {
     "${libStr.escape [sep] k}${sep}${mkValueString v}";
 
 
+  ## -- FILE FORMAT GENERATORS --
+
+
   /* Generate a key-value-style config file from an attrset.
    *
    * mkKeyValue is the same as in toINI.