How can we create a nested keyword list

When You have an Enumerable, and want to get one value… the usual suspect is Enum.reduce.

iex> l = [:a, :b, :c, :d, :e, :f]
iex> Enum.reduce l, [], fn x, acc -> Keyword.put([], x, acc) end   
# or
iex> Enum.reduce l, [], fn x, acc -> Keyword.new([{x, acc}]) end
[f: [e: [d: [c: [b: [a: []]]]]]]

This code does not solve your problem, but shows how to nest… I would reverse the list first, and add the final true to get it work.