feat(generator): add Mustache

This commit is contained in:
asimon 2026-01-25 12:10:27 +01:00
parent 5e479f3662
commit 404d8cb782
6 changed files with 26 additions and 1 deletions

View file

@ -100,6 +100,19 @@
} ''
python ${renderScript} > $out
'';
mustache = {
name,
opts,
data,
}: let
inherit (opts) template;
mustache = opts.mustache or pkgs.mustache-go;
dataJson = writeText "template-data.json" (builtins.toJSON data);
in
runCommand name {
buildInputs = [mustache];
} "mustache ${dataJson} ${template} > $out";
};
buildAllFiles = files:

View file

@ -30,7 +30,7 @@ in {
};
generator = mkOption {
type = types.enum ["nix" "string" "derivation" "gotmpl" "jinja" "template"];
type = types.enum ["nix" "string" "derivation" "gotmpl" "jinja" "mustache" "template"];
description = ''
Which engine to use for content generation.
'';