{ ... }: { flake.nixosModules.virtual-machines = { config, lib, pkgs, ... }: { config = { programs.virt-manager.enable = true; virtualisation = { libvirtd = { enable = true; qemu.swtpm.enable = true; }; spiceUSBRedirection.enable = true; }; environment.systemPackages = with pkgs; lib.mkIf config.hardware.graphics.enable [ virt-viewer ]; }; }; }