Escaping TOML attribute names with periods/dots ('.')

I’m trying to configure nixos’ services.vector.settings with the following TOML:

host = ""
inputs = ["in"]
type = "elasticsearch"

type = "journald"

And the following lines in my configuration.nix

  services.vector = {
    enable = true;
    journaldAccess = true;
    settings = { = {
        type = "journald";
      sinks.out = {
        inputs  = ["in"];
        type    = "elasticsearch";
        host    = "";

fails to evaluate with:

unexpected IN, expecting ID or OR_KW or DOLLAR_CURLY or ‘"’

Surrounding attributes in double quotes will result to
["sinks.es_cluster"] instead of
[sinks.es_cluster] which results to an invalid configuration.

How can I configure this service properly?

The error message seems to be due to a stray “in” keyword. Perhaps put try something like:

Thanks @tomberek! Using sources."in" did lose the error. However, this had a side-effect of generating 2 entries in the TOML:


Not sure if this is the expected result or should be considered as a bug.

For now I’ll just be avoiding using ‘in’ to workaround the issue.