query
On this page

createEmptyImage

pkgs.vmTools.createEmptyImage

Docs pulled from | This Revision | 10 minutes ago


A bash script fragment that produces a disk image at destination.


Noogle detected

Implementation

The following is the current implementation of this function.

createEmptyImage =
    {
      # Disk image size in MiB
      size,
      # Name that will be written to ${destination}/nix-support/full-name
      fullName,
      # Where to write the image files, defaulting to $out
      destination ? "$out",
    }:
    ''
      mkdir -p ${destination}
      diskImage=${destination}/disk-image.qcow2
      ${qemu}/bin/qemu-img create -f qcow2 $diskImage "${toString size}M"

      mkdir ${destination}/nix-support
      echo "${fullName}" > ${destination}/nix-support/full-name
    '';