Virt-manager (Error starting domain: Requested operation is not valid: network 'default' is not active) and what's the equivalent to (sudo virsh net-autostart --network default)

Hello fellow nix users :wave: .
I have just setup virt-manager in nixos, and everytime i reboot and open virt-manger and try to run any virtual machine i get this error:

Error starting domain: Requested operation is not valid: network 'default' is not active

I managed to solve this error by running: sudo virsh net-start default however this will work until you reboot the machine you will have to run it again, following this article, it explains that you have to run sudo virsh net-autostart --network default if you want to auto start that daemon automatically on startup.

The only reason i have not applied the second solution is because i am on nixos, and i am making the assumption that there will be a nixos config that does the same thing + if there is (that would be good since it will be declared in the config).

here is my nixos config:

  # virtualization
  programs.virt-manager.enable = true;
  users.groups.libvirtd.members = ["alice"];
  virtualisation.spiceUSBRedirection.enable = true;
  virtualisation.libvirtd.enable = true;

To me sounds like according to my understanding of the article one needed to set virtualisation.libvirtd.allowedBridges to what is deemed “default” (“virbr0” in the article again).

Some links around here discussing the bridge interface workings:

HTH