feat(generator): add Mustache

This commit is contained in:
asimon 2026-01-25 12:10:27 +01:00
parent 7e3efd400c
commit 26e79ede19
6 changed files with 28 additions and 1 deletions

View file

@ -100,6 +100,21 @@
} ''
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" "gomplate" "jinja" "template"];
type = types.enum ["nix" "string" "derivation" "gomplate" "jinja" "mustache" "template"];
description = ''
Which engine to use for content generation.
'';