mirror of
https://github.com/ItsDrike/nixdots
synced 2024-11-10 06:29:41 +00:00
24 lines
633 B
Nix
24 lines
633 B
Nix
{
|
|
lib,
|
|
config,
|
|
...
|
|
}: let
|
|
inherit (lib) mkIf;
|
|
cfgUser = config.myOptions.system.username;
|
|
cfg = config.myOptions.home-manager.programs.applications.virtualbox;
|
|
deviceType = config.myOptions.device.roles.type;
|
|
acceptedTypes = ["laptop" "desktop"];
|
|
in {
|
|
config = mkIf ((builtins.elem deviceType acceptedTypes) && cfg.enable) {
|
|
virtualisation.virtualbox.host = {
|
|
enable = true;
|
|
|
|
# Don't include the Qt dependency and GUI app,
|
|
# if gui is desired, it can be installed separately on a per-user basis
|
|
headless = true;
|
|
};
|
|
|
|
users.extraGroups.vboxusers.members = [ "${cfgUser}" ];
|
|
};
|
|
}
|