From 389f855de34f3e6a31212d0280aa83a266bf5c9a Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Mon, 2 Dec 2024 14:31:17 -0600 Subject: [PATCH] libvirt? --- hosts/othalan/default.nix | 13 ++++++++++--- hosts/othalan/virt.nix | 26 ++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 hosts/othalan/virt.nix diff --git a/hosts/othalan/default.nix b/hosts/othalan/default.nix index c057c5e..babfb6d 100644 --- a/hosts/othalan/default.nix +++ b/hosts/othalan/default.nix @@ -15,9 +15,16 @@ } // ( '' - vpn|desktop|hyprland|chrome - backups|hp-scanner|llm - podman|docker|vbox + desktop + hyprland + chrome + vpn + backups + llm + hp-scanner + vbox + podman + docker '' |> listify |> enableAttrs diff --git a/hosts/othalan/virt.nix b/hosts/othalan/virt.nix new file mode 100644 index 0000000..3d30397 --- /dev/null +++ b/hosts/othalan/virt.nix @@ -0,0 +1,26 @@ +{ + pkgs, + enabled, + ... +}: +{ + programs.virt-manager = enabled; + + virtualisation = { + libvirtd = enabled // { + # Enable TPM emulation (optional) + qemu = { + swtpm = enabled; + ovmf.packages = [ pkgs.OVMFFull.fd ]; + }; + + }; + + # Enable USB redirection (optional) + spiceUSBRedirection = enabled; + }; + + users.users.daylin = { + extraGroups = [ "libvirtd" ]; + }; +}