diff --git a/common.nix b/common.nix index ac47cfc..69157cc 100644 --- a/common.nix +++ b/common.nix @@ -20,6 +20,7 @@ ./services/server-permissions.nix ./services/game-servers.nix ./services/dr-server.nix + ./services/libvirtd.nix ./services/qbittorrent-nox.nix ./services/nginx.nix ./services/go2rtc.nix diff --git a/services/libvirtd.nix b/services/libvirtd.nix new file mode 100644 index 0000000..c820710 --- /dev/null +++ b/services/libvirtd.nix @@ -0,0 +1,29 @@ +{ config, pkgs, lib, ... }: +{ + config = lib.mkIf (config.networking.hostName == "FredOS-Gaming") { + # KVM-based VM stack for running a Windows guest (mainly: the DR client + # mod is wine-incompatible and has to run on real Windows). virt-manager + # is the GUI; OVMFFull provides UEFI firmware with the Secure Boot bits + # Win11 needs, and swtpm gives the guest a software TPM 2.0 to satisfy + # Win11's install check. + virtualisation.libvirtd = { + enable = true; + qemu = { + swtpm.enable = true; + ovmf = { + enable = true; + packages = [ pkgs.OVMFFull.fd ]; + }; + }; + }; + + programs.virt-manager.enable = true; + + users.users.fred.extraGroups = [ "libvirtd" ]; + + environment.systemPackages = with pkgs; [ + virt-viewer + virtio-win + ]; + }; +}