Switched to files...
This commit is contained in:
parent
57cad0cd85
commit
ace1af6209
14
to-xml.nix
14
to-xml.nix
|
@ -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; }
|
||||
|
|
Loading…
Reference in New Issue