+ system.build.nixStoreImage =
+ nixStoreImages."${cfg.nixStoreFilesystemType}";
+
+ virtualisation = {
+
+ sharedDirectories = mkForce { };
+
+ qemu.drives = [{
+ name = "nixstore";
+ file = "${config.system.build.nixStoreImage}/nixos.img";
+ driveExtraOpts = {
+ format = "raw";
+ read-only = "on";
+ werror = "report";
+ };
+ }];
+
+ };
+ }
+ (mkIf (cfg.nixStoreFilesystemType == "ext4") {
+ # We use this to disable fsck runs on the ext4 nix store image because stage-1
+ # fsck crashes (maybe because the device is read-only?), halting boot.
+ boot.initrd.checkJournalingFS = false;
+ })
+ ];