34 lines
756 B
Nix
34 lines
756 B
Nix
{
|
|
lib,
|
|
config,
|
|
...
|
|
}: let
|
|
cfg = config.services.virt-manager;
|
|
in {
|
|
options = {
|
|
services.virt-manager = {
|
|
enable = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = false;
|
|
description = ''
|
|
Enable the qemu-kvm + libvirt stack.
|
|
'';
|
|
};
|
|
forUsers = lib.mkOption {
|
|
type = lib.types.listOf lib.types.string;
|
|
default = [];
|
|
description = ''
|
|
List of users that should be added to the libvirt group.
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
programs.virt-manager.enable = true;
|
|
users.groups.libvirtd.members = cfg.forUsers;
|
|
virtualisation.libvirtd.enable = true;
|
|
virtualisation.spiceUSBRedirection.enable = true;
|
|
};
|
|
}
|