Files
homelab/modules/virtualization/qemu.nix
T
pure_sagacity 3a17b271f7 debugging...
apperently I only needed to change like 5 lines?? I locked the hell in
2026-07-06 00:09:24 -05:00

45 lines
834 B
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.homelab.virtualization;
in
{
config = lib.mkMerge [
(lib.mkIf cfg.qemu.enable {
virtualisation = {
libvirtd = {
enable = true;
qemu = {
package = pkgs.qemu_kvm;
swtpm.enable = true;
};
};
};
users.users.${cfg.user}.extraGroups = [
"libvirtd"
"kvm"
];
})
(lib.mkIf cfg.qemu.spiceUSBRedirection {
virtualisation.spiceUSBRedirection.enable = true;
})
(lib.mkIf cfg.qemu.virtManager {
programs.virt-manager.enable = true;
})
(lib.mkIf (cfg.qemu.enable && cfg.qemu.containers) {
virtualisation.containers.enable = true;
})
(lib.mkIf cfg.qemu.enable {
boot.kernelModules = cfg.qemu.bootModules;
})
];
}