See also Nix, which can declaratively generate Dockerfiles (example on home page) :-)
This is inaccurate, assuming you are referring to the 'dockerTools.buildLayeredImage' function in the nixpkgs repository.
That builds docker images declaratively, not dockerfiles.