Adding qemu-guest-agent to a nixos VM

I’m looking to have the qemu guest agent running in my nix VM.

I’ve found https://github.com/NixOS/nixpkgs/blob/3285f0f2ff36aea7d5e87520a3e9ef66c44f87b8/nixos/modules/virtualisation/qemu-guest-agent.nix but don’t know how to apply this and am very new to nixos.

Just add services.qemuGuest.enable = true; to your NixOS configuration
and that should do the trick.