diff options
author | Justin Bedo <cu@cua0.org> | 2019-04-30 09:47:49 +1000 |
---|---|---|
committer | Justin Bedo <cu@cua0.org> | 2019-04-30 09:47:49 +1000 |
commit | a1d18efc18772a233aa759b622c3a9960824f109 (patch) | |
tree | c8e4028b4b634cfe7002c79539563256894e0d48 /examples/ex-wdl | |
parent | e9b908b0cdc22a7b43301e63a23c7911aa371721 (diff) |
cleanup examples and stray files
Diffstat (limited to 'examples/ex-wdl')
-rw-r--r-- | examples/ex-wdl/wdl-scatter-gather.nix | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/examples/ex-wdl/wdl-scatter-gather.nix b/examples/ex-wdl/wdl-scatter-gather.nix new file mode 100644 index 0000000..387d382 --- /dev/null +++ b/examples/ex-wdl/wdl-scatter-gather.nix @@ -0,0 +1,33 @@ +# The scatter-gather example from https://github.com/openwdl/wdl +# translated to bionix +{ bionix ? import <bionix> {} }: + +with bionix; +with lib; + +let + + prepare = splitString "\n" (removeSuffix "\n" (readFile (stage { + name = "prepare"; + buildInputs = [ pkgs.python3 ]; + buildCommand = '' + python -c "print('one\ntwo\nthree\nfour', end=''')" > $out + ''; + }))); + + analysis = str: removeSuffix "\n" (readFile (stage { + name = "analysis"; + buildInputs = [ pkgs.python ]; + buildCommand = '' + python -c "print('_${str}_')" > $out + ''; + })); + + gather = strs: stage { + name = "gather"; + buildCommand = '' + echo ${concatStringsSep " " strs} > $out + ''; + }; + +in gather (map analysis prepare) |