32 lines
655 B
Nix
32 lines
655 B
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
with lib;
|
|
{
|
|
|
|
options.components.virtualisation.qemu.enable = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = config.components.virtualisation.enable;
|
|
};
|
|
|
|
config = mkIf config.components.virtualisation.qemu.enable {
|
|
|
|
virtualisation.libvirtd.enable = true;
|
|
#virtualisation.libvirtd.allowedBridges = ["virbr0"];
|
|
virtualisation.libvirtd.onShutdown = "shutdown";
|
|
|
|
environment.systemPackages = [
|
|
pkgs.qemu_kvm
|
|
#(pkgs.quickemu.override { qemu_full = pkgs.qemu_kvm; })
|
|
pkgs.quickemu
|
|
pkgs.virt-manager
|
|
];
|
|
|
|
users.users.mainUser.extraGroups = [ "libvirtd" ];
|
|
|
|
};
|
|
|
|
}
|