lol

singularity-tools: enable __structuredAttrs and pass contents directly (#358723)

authored by philiptaron.tngl.sh and committed by

GitHub 62742e9d 9af37651

+3 -6
+3 -6
pkgs/build-support/singularity-tools/default.nix
··· 51 result = vmTools.runInLinuxVM ( 52 runCommand "${projectName}-image-${name}.sif" 53 { 54 nativeBuildInputs = [ 55 singularity 56 e2fsprogs 57 util-linux 58 ]; 59 strictDeps = true; 60 layerClosure = writeClosure ([ bashInteractive ] ++ runScriptReferences ++ contents); 61 preVM = vmTools.createEmptyImage { 62 size = diskSize; ··· 89 cp -ar "$f" "./$f" 90 done < "$layerClosure" 91 92 - # TODO(@ShamrockLee): 93 - # Once vmTools.runInLinuxVMm works with `__structuredAttrs = true` (#334705), 94 - # set __structuredAttrs = true and pass contents as an attribute 95 - # so that we could loop with `for c in ''${contents[@]}` 96 - # instead of expanding all the paths in contents into the Bash string. 97 - for c in ${lib.escapeShellArgs contents} ; do 98 for f in "$c"/bin/* ; do 99 if [ ! -e "bin/$(basename "$f")" ] ; then 100 ln -s "$f" bin/
··· 51 result = vmTools.runInLinuxVM ( 52 runCommand "${projectName}-image-${name}.sif" 53 { 54 + __structuredAttrs = true; 55 nativeBuildInputs = [ 56 singularity 57 e2fsprogs 58 util-linux 59 ]; 60 strictDeps = true; 61 + inherit contents; 62 layerClosure = writeClosure ([ bashInteractive ] ++ runScriptReferences ++ contents); 63 preVM = vmTools.createEmptyImage { 64 size = diskSize; ··· 91 cp -ar "$f" "./$f" 92 done < "$layerClosure" 93 94 + for c in "''${contents[@]}"; do 95 for f in "$c"/bin/* ; do 96 if [ ! -e "bin/$(basename "$f")" ] ; then 97 ln -s "$f" bin/