diff --git a/lib/trivial.nix b/lib/trivial.nix index dee7eca9699a..f4a8f0d9bec5 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