anchor.diff:            -smp ${toString config.virtualisation.cores} \
             -device virtio-rng-pci \
             ${concatStringsSep " " config.virtualisation.qemu.networkingOptions} \
  -          -virtfs local,path=/nix/store,security_model=none,mount_tag=store \
  -          -virtfs local,path=$TMPDIR/xchg,security_model=none,mount_tag=xchg \
  -          -virtfs local,path=''${SHARED_DIR:-$TMPDIR/xchg},security_model=none,mount_tag=shared \
  +          ${concatStringsSep " \\\n    "
  +            (mapAttrsToList
  +              (tag: share: "-virtfs local,path=${share.source},security_model=none,mount_tag=${tag}")
  +              config.virtualisation.sharedDirectories)} \
             ${drivesCmdLine config.virtualisation.qemu.drives} \
             ${concatStringsSep " \\\n    " config.virtualisation.qemu.options} \
             $QEMU_OPTS \
  
positive.code:           '';
        };
  
      virtualisation.pathsInNixDB =
        mkOption {
          type = types.listOf types.path;
  
negative.code:     # configuration, where the regular value for the `fileSystems'
      # attribute should be disregarded for the purpose of building a VM
      # test image (since those filesystems don't exist in the VM).
      fileSystems =
      let
        mkSharedDir = tag: share:
          {
            name =
              if tag == "nix-store" && cfg.writableStore
                then "/nix/.ro-store"
                else share.target;
            value.device = tag;
            value.fsType = "9p";
            value.neededForBoot = true;
            value.options =
              [ "trans=virtio" "version=9p2000.L"  "msize=${toString cfg.msize}" ]
              ++ lib.optional (tag == "nix-store") "cache=loose";
          };
      in
        mkVMOverride (cfg.fileSystems //
        {
          "/".device = cfg.bootDevice;
  
          "/tmp" = mkIf config.boot.tmpOnTmpfs
            { device = "tmpfs";
              fsType = "tmpfs";
  