Quickemu and shared clipboard

Hello everyone,
I use Qickemu for virtualisation of Windows. the problem I face is to enable shared clipboard, so I have already tried to install the following packages

    # Virtualiwation
    virt-manager
    qemu_full
    libvirt
    virtiofsd
    quickemu
    quickgui
    spice-vdagent
    spice
    spice-gtk

I created this file:

# ~/.nixos/nixos/virtualisation/qemu.nix

{
  pkgs,
  ...
}:
{
  virtualisation.qemu.options = [
      "-vga qxl"
      "-spice port=5924,disable-ticketing=on"
      "-device virtio-serial -chardev spicevmc,id=vdagent,debug=0,name=vdagent"
      "-device virtserialport,chardev=vdagent,name=com.redhat.spice.0"
  ];
} 

I imported it to main config file ~/.nixos/nixos/configuration.nix and there I activated service

services.spice-vdagentd.enable 		= true;

but when I try to build I have this issue:

error: The option `virtualisation.qemu' does not exist. Definition values:
       - In `/nix/store/hanqix5ij0nbchdxa9z1pddgis1a4d0d-source/nixos/virtualization/qemu.nix':
           {
             options = [
               "-vga qxl"
               "-spice port=5924,disable-ticketing=on"
               "-device virtio-serial -chardev spicevmc,id=vdagent,debug=0,name=vdagent"
           ...

What am I doing wrong?

Hey, I don’t have experience with shared clipboard on qemu. But I do with VirtualBox. As far as I can remember it just worked.

Did you install the guest tools? (Windows SPICE Guest Tools on Download)

Also, make sure you are connecting with a spice client like virt-viewer or spice-gtk.

For qemu I just use this. I stole that from nix-config/services/virt-manager.nix at 336022c981721a92215028aff025ae753573cb44 · lovesegfault/nix-config · GitHub.

{ pkgs, ... }: {
  environment.systemPackages = with pkgs; [ virt-manager spice-gtk swtpm ];
  security.polkit.enable = true;
  virtualisation = {
    libvirtd = {
      enable = true;
      qemu = {
        package = pkgs.qemu_kvm;
        ovmf = {
          enable = true;
          packages = with pkgs; [ OVMFFull.fd ];
        };
        swtpm.enable = true;
      };
    };
    spiceUSBRedirection.enable = true;
  };
}

Does this work on Gnome? Doesn’t seem to be working for me.