From b4afc8bab81953cc95b9ff5807e1646a6904ea84 Mon Sep 17 00:00:00 2001 From: Wim de With Date: Fri, 12 Jan 2024 14:15:58 +0100 Subject: [PATCH] make-disk-image: set image format explicitly QEMU warns if format=raw is implied, and protects block 0 from getting overwritten. --- lib/make-disk-image.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/make-disk-image.nix b/lib/make-disk-image.nix index 572daa2..6343664 100644 --- a/lib/make-disk-image.nix +++ b/lib/make-disk-image.nix @@ -64,7 +64,7 @@ let ${systemToInstall.config.system.build.nixos-install}/bin/nixos-install --system ${systemToInstall.config.system.build.toplevel} --keep-going --no-channel-copy -v --no-root-password --option binary-caches "" umount -Rv ${systemToInstall.config.disko.rootMountPoint} ''; - QEMU_OPTS = lib.concatMapStringsSep " " (disk: "-drive file=${disk.name}.raw,if=virtio,cache=unsafe,werror=report") (lib.attrValues nixosConfig.config.disko.devices.disk); + QEMU_OPTS = lib.concatMapStringsSep " " (disk: "-drive file=${disk.name}.raw,if=virtio,cache=unsafe,werror=report,format=raw") (lib.attrValues nixosConfig.config.disko.devices.disk); in { pure = vmTools.runInLinuxVM (pkgs.runCommand name