WIP: test refactoring

This commit is contained in:
Jaka Hudoklin 2020-04-05 21:25:34 +07:00 committed by David Arnold
parent 8ad3b90a52
commit bbc5e3d477
No known key found for this signature in database
GPG key ID: 6D6A936E69C59D08
17 changed files with 714 additions and 66 deletions

View file

@ -30,6 +30,12 @@ rec {
remarshal -i ${pkgs.writeText "to-json" (builtins.toJSON config)} -if json -of yaml > $out
'');
toMultiDocumentYaml = name: documents: pkgs.runCommand name {
buildInputs = [ pkgs.remarshal ];
} (concatMapStringsSep "\necho --- >> $out\n" (d:
"remarshal -i ${builtins.toFile "doc" (builtins.toJSON d)} -if json -of yaml >> $out"
) documents);
toBase64 = value:
builtins.readFile
(pkgs.runCommand "value-to-b64" {} "echo -n '${value}' | ${pkgs.coreutils}/bin/base64 -w0 > $out");