2024-07-08 13:17:21 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit (lib) mkIf;
|
2024-07-08 15:47:41 +00:00
|
|
|
cfgUser = config.myOptions.system.username;
|
2024-07-08 13:17:21 +00:00
|
|
|
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;
|
|
|
|
};
|
2024-07-08 15:47:41 +00:00
|
|
|
|
2024-07-26 23:07:07 +00:00
|
|
|
users.extraGroups.vboxusers.members = ["${cfgUser}"];
|
2024-07-08 13:17:21 +00:00
|
|
|
};
|
|
|
|
}
|