{ lib, pkgs, toXML, ... }: name: content: let preformatXML = pkgs.writeText "${name}-preformat.xml" (toXML content); in pkgs.stdenv.mkDerivation { name = "${name}.xml"; phases = [ "installPhase" ]; buildInputs = with pkgs; [ xmlformat ]; installPhase = "xmlformat ${preformatXML} > $out"; }