mirror of
https://gitlab.com/TECHNOFAB/soonix.git
synced 2026-02-02 07:15:06 +01:00
feat(generator): add Mustache
This commit is contained in:
parent
7e3efd400c
commit
26e79ede19
6 changed files with 28 additions and 1 deletions
15
lib/lib.nix
15
lib/lib.nix
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue