feat(virtualbox): add kvm virtualbox host
This commit is contained in:
parent
73d8353724
commit
e2a68ae422
34
global/virtualbox/default.nix
Normal file
34
global/virtualbox/default.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{ pkgs
|
||||
, lib
|
||||
, config
|
||||
, ... }: with lib; let
|
||||
cfg = config.global.virtualbox;
|
||||
in {
|
||||
options.global.virtualbox = {
|
||||
enable = mkEnableOption "virtualbox host (kvm)";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
virtualisation.virtualbox.host = {
|
||||
enable = true;
|
||||
enableKvm = true;
|
||||
enableExtensionPack = true;
|
||||
|
||||
enableHardening = false;
|
||||
addNetworkInterface = false;
|
||||
};
|
||||
|
||||
# allow virtualbox USB passthrough
|
||||
users.adminGroups = [ "vboxusers" ];
|
||||
|
||||
users.home.persist.directories = [
|
||||
".config/VirtualBox"
|
||||
];
|
||||
|
||||
users.homeModules = [ {
|
||||
wayland.windowManager.sway.config.window.commands = [
|
||||
{ criteria.class = "VirtualBox Manager"; command = "floating enable"; }
|
||||
];
|
||||
} ];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue