mirror of
https://github.com/nix-community/noogle.git
synced 2024-09-19 21:27:13 +03:00
d9f579cf44
* 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
33 lines
373 B
Markdown
33 lines
373 B
Markdown
# 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)
|
|
```
|