about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--lib/trivial.nix29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/trivial.nix b/lib/trivial.nix
index dee7eca9699a0..f4a8f0d9bec57 100644
--- a/lib/trivial.nix
+++ b/lib/trivial.nix
@@ -642,6 +642,35 @@ in {
   /**
     Reads a TOML file.
 
+    # Examples
+    :::{.example}
+    ## `lib.trivial.importTOML` usage example
+
+    example.toml
+    ```toml
+    title = "TOML Example"
+
+    [hello]
+    world = "foo"
+
+    [hello.bar]
+    foobar = true
+    ```
+
+    ```nix
+    importTOML ./example.toml
+    => {
+      title = "TOML Example";
+      hello = {
+        world = "foo";
+        bar = {
+          foobar = true;
+        };
+      };
+    }
+    ```
+
+    :::
 
     # Inputs