noogle/scripts/data/fromTOML.md
Johannes Kirschbauer d9f579cf44
Feature/monorepo (#24)
* refactor to include all necessary dependencies directly here

* move indexer into monorepo

* add snapshot tests and seperate sub.project for builtin types

* add more missing builtins such as fromTOML
2023-02-25 13:14:40 +01:00

373 B

Parse a TOML-configuration from String

builtins.fromTOML ''
# Toplevel
foo = "bar"

# Simple Attrset
[set]
info = "foobar"

# Nested Attrset
[set.nested]
meta = 42
''
-> 
{
  foo = "bar";
  set = {
    info = "foobar";
    nested = {
      meta = 42;
    };
  };
}

Also works nicely with readFile:

builtins.fromTOML (builtins.readFile ./config.toml)