make-disk-image: umount filesystems after install

The vmTools in nixpkgs shuts the VM down with poweroff -f, which does
not cleanly umount the filesystems. This may lead to filesystem
corruption on the newly created image.
This commit is contained in:
Wim de With 2024-01-12 14:13:18 +01:00 committed by mergify[bot]
parent fa5db12d76
commit c38f369ee4

View File

@ -62,6 +62,7 @@ let
'';
installer = ''
${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);
in