build-support: Add writeTextDir (forgotten commit for merged nixos modules)

I just noticed that my latest commits to nixos were missing this function.

This `writeTextFile` based helper function is especially usefull for writing a bunch of configuration files to root of the output folder