lol

singularity-tool: format expression

+31 -26
+31 -26
pkgs/build-support/singularity-tools/default.nix
··· 10 10 , gawk 11 11 , util-linux 12 12 , runtimeShell 13 - , e2fsprogs }: 14 - 13 + , e2fsprogs 14 + }: 15 15 rec { 16 16 shellScript = name: text: 17 17 writeScript name '' ··· 20 20 ${text} 21 21 ''; 22 22 23 - mkLayer = { 24 - name, 25 - contents ? [], 26 - }: 27 - runCommand "singularity-layer-${name}" { 28 - inherit contents; 29 - } '' 23 + mkLayer = 24 + { name 25 + , contents ? [ ] 26 + , 27 + }: 28 + runCommand "singularity-layer-${name}" 29 + { 30 + inherit contents; 31 + } '' 30 32 mkdir $out 31 33 for f in $contents ; do 32 34 cp -ra $f $out/ 33 35 done 34 36 ''; 35 37 36 - buildImage = { 37 - name, 38 - contents ? [], 39 - diskSize ? 1024, 40 - runScript ? "#!${stdenv.shell}\nexec /bin/sh", 41 - runAsRoot ? null, 42 - memSize ? 512 43 - }: 44 - let layer = mkLayer { 45 - inherit name; 46 - contents = contents ++ [ bash runScriptFile ]; 47 - }; 48 - runAsRootFile = shellScript "run-as-root.sh" runAsRoot; 49 - runScriptFile = shellScript "run-script.sh" runScript; 50 - result = vmTools.runInLinuxVM ( 51 - runCommand "singularity-image-${name}.img" { 38 + buildImage = 39 + { name 40 + , contents ? [ ] 41 + , diskSize ? 1024 42 + , runScript ? "#!${stdenv.shell}\nexec /bin/sh" 43 + , runAsRoot ? null 44 + , memSize ? 512 45 + }: 46 + let 47 + layer = mkLayer { 48 + inherit name; 49 + contents = contents ++ [ bash runScriptFile ]; 50 + }; 51 + runAsRootFile = shellScript "run-as-root.sh" runAsRoot; 52 + runScriptFile = shellScript "run-script.sh" runScript; 53 + result = vmTools.runInLinuxVM ( 54 + runCommand "singularity-image-${name}.img" 55 + { 52 56 buildInputs = [ singularity e2fsprogs util-linux gawk ]; 53 57 layerClosure = writeReferencesToFile layer; 54 58 preVM = vmTools.createEmptyImage { ··· 106 110 TMPDIR=$(pwd -P) singularity build $out ./img 107 111 ''); 108 112 109 - in result; 113 + in 114 + result; 110 115 }