lib/salt-support/expand-template: fix for nix/pkgs/ap.sh
This commit is contained in:
parent
0cdef19a7c
commit
a896652436
|
@ -5,11 +5,19 @@ name: template: data:
|
||||||
let
|
let
|
||||||
jsonFile =
|
jsonFile =
|
||||||
builtins.toFile "data.json" (builtins.toJSON data);
|
builtins.toFile "data.json" (builtins.toJSON data);
|
||||||
|
j2custom =
|
||||||
|
builtins.toFile "j2custom.py" ''
|
||||||
|
def j2_environment(env):
|
||||||
|
env.globals.update(
|
||||||
|
zip=zip
|
||||||
|
)
|
||||||
|
return env
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
pkgs.runCommandLocal name {
|
pkgs.runCommandLocal name {
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; [
|
||||||
pythonPackages.j2cli yaml2json
|
pythonPackages.j2cli yaml2json
|
||||||
];
|
];
|
||||||
} ''
|
} ''
|
||||||
j2 -f json ${template} ${jsonFile} > $out
|
j2 --customize ${j2custom} -f json ${template} ${jsonFile} > $out
|
||||||
''
|
''
|
||||||
|
|
Loading…
Reference in New Issue