at master 1.5 kB view raw
1{ pkgs, ... }: 2let 3 bash = pkgs.dockerTools.pullImage { 4 imageName = "quay.io/nextflow/bash"; 5 imageDigest = "sha256:bea0e244b7c5367b2b0de687e7d28f692013aa18970941c7dd184450125163ac"; 6 sha256 = "161s9f24njjx87qrwq0c9nmnwvyc6iblcxka7hirw78lm7i9x4w5"; 7 finalImageName = "quay.io/nextflow/bash"; 8 }; 9 10 hello = pkgs.stdenv.mkDerivation { 11 name = "nextflow-hello"; 12 src = pkgs.fetchFromGitHub { 13 owner = "nextflow-io"; 14 repo = "hello"; 15 rev = "afff16a9b45c8e8a4f5a3743780ac13a541762f8"; 16 hash = "sha256-c8FirHc+J5Y439g0BdHxRtXVrOAzIrGEKA0m1mp9b/U="; 17 }; 18 installPhase = '' 19 cp -r $src $out 20 ''; 21 }; 22 run-nextflow-pipeline = pkgs.writeShellApplication { 23 name = "run-nextflow-pipeline"; 24 runtimeInputs = [ pkgs.nextflow ]; 25 text = '' 26 export NXF_OFFLINE=true 27 for b in false true; do 28 echo "docker.enabled = $b" > nextflow.config 29 cat nextflow.config 30 nextflow run -ansi-log false ${hello} 31 done 32 ''; 33 }; 34in 35{ 36 name = "nextflow"; 37 38 nodes.machine = 39 { ... }: 40 { 41 environment.systemPackages = [ 42 run-nextflow-pipeline 43 pkgs.nextflow 44 ]; 45 virtualisation = { 46 docker.enable = true; 47 }; 48 }; 49 50 testScript = 51 { nodes, ... }: 52 '' 53 start_all() 54 machine.wait_for_unit("docker.service") 55 machine.succeed("docker load < ${bash}") 56 machine.succeed("run-nextflow-pipeline >&2") 57 ''; 58}