anchor.diff:              options = [ "mode=1777" "strictatime" "nosuid" "nodev" "size=${toString config.boot.tmpOnTmpfsSize}" ];
             };
   
  +        "/nix/${if cfg.writableStore then ".ro-store" else "store"}" =
  +          mkIf cfg.useNixStoreImage
  +            { device = "${lookupDriveDeviceName "nix-store" cfg.qemu.drives}";
  +              neededForBoot = true;
  +              options = [ "ro" ];
  +            };
  +
           "/nix/.rw-store" = mkIf (cfg.writableStore && cfg.writableStoreUseTmpfs)
             { fsType = "tmpfs";
               options = [ "mode=0755" ];
  
positive.code:         '' # */
      );
  
  in
  
  {
  
negative.code:       if [ -z "$TMPDIR" ] || [ -z "$USE_TMPDIR" ]; then
            TMPDIR=$(mktemp -d nix-vm.XXXXXXXXXX --tmpdir)
        fi
  
        ${lib.optionalString cfg.useNixStoreImage
        ''
          # Create a writable copy/snapshot of the store image.
          ${qemu}/bin/qemu-img create -f qcow2 -F qcow2 -b ${storeImage}/nixos.qcow2 "$TMPDIR"/store.img
        ''}
  
        # Create a directory for exchanging data with the VM.
        mkdir -p "$TMPDIR/xchg"
  