singularity-tools: enable __structuredAttrs and pass contents directly (#358723)
This commit is contained in:
commit
62742e9d5e
@ -51,12 +51,14 @@ lib.makeExtensible (final: {
|
||||
result = vmTools.runInLinuxVM (
|
||||
runCommand "${projectName}-image-${name}.sif"
|
||||
{
|
||||
__structuredAttrs = true;
|
||||
nativeBuildInputs = [
|
||||
singularity
|
||||
e2fsprogs
|
||||
util-linux
|
||||
];
|
||||
strictDeps = true;
|
||||
inherit contents;
|
||||
layerClosure = writeClosure ([ bashInteractive ] ++ runScriptReferences ++ contents);
|
||||
preVM = vmTools.createEmptyImage {
|
||||
size = diskSize;
|
||||
@ -89,12 +91,7 @@ lib.makeExtensible (final: {
|
||||
cp -ar "$f" "./$f"
|
||||
done < "$layerClosure"
|
||||
|
||||
# TODO(@ShamrockLee):
|
||||
# Once vmTools.runInLinuxVMm works with `__structuredAttrs = true` (#334705),
|
||||
# set __structuredAttrs = true and pass contents as an attribute
|
||||
# so that we could loop with `for c in ''${contents[@]}`
|
||||
# instead of expanding all the paths in contents into the Bash string.
|
||||
for c in ${lib.escapeShellArgs contents} ; do
|
||||
for c in "''${contents[@]}"; do
|
||||
for f in "$c"/bin/* ; do
|
||||
if [ ! -e "bin/$(basename "$f")" ] ; then
|
||||
ln -s "$f" bin/
|
||||
|
Loading…
Reference in New Issue
Block a user