anchor.diff:            '';
         };
   
  +    virtualisation.sharedDirectories =
  +      mkOption {
  +        type = types.attrsOf
  +          (types.submodule {
  +            options.source = mkOption {
  +              type = types.str;
  +              description = "The path of the directory to share, can be a shell variable";
  +            };
  +            options.target = mkOption {
  +              type = types.path;
  +              description = "The mount point of the directory inside the virtual machine";
  +            };
  +          });
  +        default = { };
  +        example = {
  +          my-share = { source = "/path/to/be/shared"; target = "/mnt/shared"; };
  +        };
  +        description =
  +          ''
  +            An attributes set of directories that will be shared with the
  +            virtual machine using VirtFS (9P filesystem over VirtIO).
  +            The attribute name will be used as the 9P mount tag.
  +          '';
  +      };
  +
       virtualisation.pathsInNixDB =
         mkOption {
           type = types.listOf types.path;
  
positive.code:           -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 \
            ${drivesCmdLine config.virtualisation.qemu.drives} \
            ${concatStringsSep " \\\n    " config.virtualisation.qemu.options} \
            $QEMU_OPTS \
  
negative.code:     virtualisation.bootDevice = mkDefault (driveDeviceName 1);
  
      virtualisation.pathsInNixDB = [ config.system.build.toplevel ];
  
      virtualisation.sharedDirectories = {
        nix-store = { source = "/nix/store"; target = "/nix/store"; };
        xchg      = { source = ''"$TMPDIR"/xchg''; target = "/tmp/xchg"; };
        shared    = { source = ''"''${SHARED_DIR:-$TMPDIR/xchg}"''; target = "/tmp/shared"; };
      };
  
      # FIXME: Consolidate this one day.
      virtualisation.qemu.options = mkMerge [
  