nixos-config/modules/core/virtualization.nix

51 lines
1.2 KiB
Nix
Raw Normal View History

{
pkgs,
host,
config,
username,
...
}:
2023-11-05 11:40:44 +01:00
{
2025-04-14 09:24:35 +02:00
virtualisation = {
# vmware.host.enable = true; # Causes issues for now :p
waydroid.enable = if (host == "sakura") then true else false;
libvirtd.enable =
if (host == "violet") then
true
else if (host == "dandelion") then
true
else if (host == "sakura") then
true
else if (host == "yoshino") then
true
2025-09-05 18:44:50 +02:00
else if (host == "iris") then
true
else if (host == "imilia") then
true
else
false;
spiceUSBRedirection.enable =
if (config.virtualisation.libvirtd.enable == true) then true else false;
2025-04-14 09:24:35 +02:00
};
programs.virt-manager.enable =
if (config.virtualisation.waydroid.enable == true) then true else false;
#dconf.settings."org/virt-manager/virt-manager/connections" =
# if (config.programs.virt-manager.enable == true) then
# {
# autoconnect = [ "qemu:///system" ];
# uris = [ "qemu:///system" ];
# }
# else
# { };
users.groups.libvirtd.members =
if (config.virtualisation.libvirtd.enable == true) then [ username ] else [ ];
# Enable qemu etc
environment.systemPackages = with pkgs; [
qemu
quickemu
];
}