/yaml2json.nix Secret
Created
November 9, 2018 14:17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
patchPhase = '' | |
${python3}/bin/python - << EOF | |
import yaml | |
import json | |
def yaml2json(yaml_file, json_file): | |
with open(yaml_file, "r") as i, open(json_file, "w") as o: | |
o.write(json.dumps(yaml.load(i.read()))) | |
yaml2json("apm-server.yml", "apm-server.json") | |
yaml2json("fields.yml", "fields.json") | |
EOF | |
cat apm-server.json | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment