(no title)
granra | 3 months ago
I really wanted the templates to just be nix functions. It shouldn't be an issue to pass the context to an external program with `pkgs.runCommand` or something and then read the result (IFD like you mentioned).
Edit: I'm glad to hear you like it :)
mikepurvis|3 months ago
However, if you did want it to be nix all the way down and get more of that juicy dependency granularity, it could be more of a model where content and templates are transformed upfront into Nix source, which is then transformed and combined during evaluation. Obviously this is fairly slow in an IFD world where all that pre-work has to be serialized, but it would be interesting to experiment with what it looks like in a dynamic derivations context.
granra|3 months ago
[1]: https://github.com/arnarg/nixidy
lloeki|3 months ago
This feels like Ruby template engines like haml† and slim†† a lot, or the various xml builders††† too
† https://github.com/haml/haml
†† https://slim-template.github.io
††† https://nokogiri.org/rdoc/Nokogiri/XML/Builder.html#class-No...
mikepurvis|3 months ago
https://docs.groovy-lang.org/docs/groovy-2.5.3/html/document...
It can make a lot more sense as a way to prepare a smaller snippet of XML though, for example an xunit reponse.