From 343c508be62e3e83165049907375abfc98a3ccbf Mon Sep 17 00:00:00 2001 From: Emmet Date: Sat, 28 Oct 2023 20:43:37 -0500 Subject: [PATCH] Fixes qemu user session uefi --- profiles/work/configuration.nix | 1 + system/app/virtualization.nix | 13 +++++++++++++ user/app/virtualization/virtualization.nix | 5 +++++ 3 files changed, 19 insertions(+) create mode 100644 system/app/virtualization.nix diff --git a/profiles/work/configuration.nix b/profiles/work/configuration.nix index 0bf46a6..4118fb8 100644 --- a/profiles/work/configuration.nix +++ b/profiles/work/configuration.nix @@ -13,6 +13,7 @@ ../../system/hardware/bluetooth.nix (./. + "../../../system/wm"+("/"+wm)+".nix") # My window manager ../../system/app/flatpak.nix + ../../system/app/virtualization.nix ../../system/security/doas.nix ../../system/security/gpg.nix ../../system/security/blocklist.nix diff --git a/system/app/virtualization.nix b/system/app/virtualization.nix new file mode 100644 index 0000000..6f56e09 --- /dev/null +++ b/system/app/virtualization.nix @@ -0,0 +1,13 @@ +{ config, lib, pkgs, ... }: + +{ + environment.systemPackages = [ pkgs.virt-manager ]; + virtualisation.libvirtd = { + allowedBridges = [ + "nm-bridge" + "virbr0" + ]; + enable = true; + qemuRunAsRoot = false; + }; +} diff --git a/user/app/virtualization/virtualization.nix b/user/app/virtualization/virtualization.nix index 75fdfd4..db49fcc 100644 --- a/user/app/virtualization/virtualization.nix +++ b/user/app/virtualization/virtualization.nix @@ -7,6 +7,7 @@ libvirt virt-manager qemu + uefi-run lxc swtpm bottles @@ -15,4 +16,8 @@ dosfstools ]; + home.file.".config/libvirt/qemu.conf".text = '' +nvram = ["/run/libvirt/nix-ovmf/OVMF_CODE.fd:/run/libvirt/nix-ovmf/OVMF_VARS.fd"] + ''; + }