Switched to files...

This commit is contained in:
niten 2024-03-23 11:24:18 -07:00
parent 57cad0cd85
commit ace1af6209
1 changed files with 1 additions and 13 deletions

View File

@ -1,4 +1,4 @@
{ config, lib, pkgs, ... }:
{ lib, ... }:
with lib;
let
@ -18,16 +18,4 @@ let
body = concatStringsSep "" (map renderElement children);
in renderTag tag attrs body;
toXMLFile = 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";
};
toFormattedXML = content:
let xmlFile = toXMLFile "formatted-xml" content;
in readFile xmlFile;
in { inherit toXML toXMLFile toFormattedXML; }