singularity-tools: create VM disk image outside $out

Place the VM disk image in a local directory "disk-image" instead of
"$out", so that we don't have to delete it to reserve "$out" for the
container image.
This commit is contained in:
Yueh-Shun Li
2024-08-11 10:25:20 +08:00
parent e8360a61bc
commit a7b54b36c5
@@ -92,11 +92,13 @@ lib.makeExtensible (final: {
preVM = vmTools.createEmptyImage {
size = diskSize;
fullName = "${projectName}-run-disk";
# Leaving "$out" for the Singularity/Container image
destination = "disk-image";
};
inherit memSize;
}
''
rm -rf $out
rmdir "$out"
mkdir disk
mkfs -t ext3 -b 4096 /dev/${vmTools.hd}
mount /dev/${vmTools.hd} disk