diff --git a/hosts/flubber-machine/default.nix b/hosts/flubber-machine/default.nix index 224e63f..09f510c 100755 --- a/hosts/flubber-machine/default.nix +++ b/hosts/flubber-machine/default.nix @@ -95,6 +95,7 @@ system.ananicy.enable = true; system.zswap.enable = true; system.kdeconnect.enable = true; + system.virt-manager.enable = true; # editors editors.micro.enable = true; editors.vscode.enable = true; diff --git a/modules/software/system/virt-manager.nix b/modules/software/system/virt-manager.nix new file mode 100644 index 0000000..0cf728d --- /dev/null +++ b/modules/software/system/virt-manager.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.modules.software.system.virt-manager; +in { + options.modules.software.system.virt-manager = { + enable = mkEnableOption "Enable virt-manager, a GUI VM manager and runner"; + }; + + config = mkIf cfg.enable { + programs.virt-manager.enable = true; + + users.groups.libvirtd.members = [ config.user.name ]; + + virtualisation.libvirtd.enable = true; + virtualisation.libvirtd.qemu.vhostUserPackages = with pkgs; [ virtiofsd ]; + virtualisation.spiceUSBRedirection.enable = true; + + hm.dconf.settings."org/virt-manager/virt-manager/connections" = { + autoconnect = ["qemu:///system"]; + uris = ["qemu:///system"]; + }; + }; +}