This commit is contained in:
Madeleine Sydney
2025-03-23 23:16:03 -06:00
parent c3c1359b4f
commit ef9943b707
22 changed files with 300 additions and 106 deletions

29
modules/nixos/qemu.nix Normal file
View File

@@ -0,0 +1,29 @@
{ config, lib, pkgs, ... }:
with lib;
let cfg = config.sydnix.qemu;
in {
options.sydnix.qemu = {
enable = mkEnableOption "Qemu";
};
config = mkIf cfg.enable
(let
# Necessary for UEFI boot with libvirt.
qemu-uefi = pkgs.writeShellScriptBin "qemu-system-x86_64-uefi" ''
qemu-system-x86_64 \
-bios ${pkgs.OVMF.fd}/FV/OVMF.fd \
"$@"
'';
in {
programs.virt-manager.enable = true;
environment.systemPackages = [
pkgs.virtiofsd
qemu-uefi
];
virtualisation.libvirtd.enable = true;
});
}