16 lines
286 B
Nix
16 lines
286 B
Nix
|
{ pkgs ? import <nixpkgs> {}
|
||
|
}:
|
||
|
|
||
|
name: template: data:
|
||
|
let
|
||
|
jsonFile =
|
||
|
builtins.toFile "data.json" (builtins.toJSON data);
|
||
|
in
|
||
|
pkgs.runCommandLocal name {
|
||
|
nativeBuildInputs = with pkgs; [
|
||
|
pythonPackages.j2cli yaml2json
|
||
|
];
|
||
|
} ''
|
||
|
j2 -f json ${template} ${jsonFile} > $out
|
||
|
''
|