stockholm/lass/2configs/virtualbox.nix
2018-06-27 23:57:25 +02:00

26 lines
640 B
Nix

{ config, pkgs, ... }:
let
mainUser = config.users.extraUsers.mainUser;
in {
#services.virtualboxHost.enable = true;
virtualisation.virtualbox.host.enable = true;
nixpkgs.config.virtualbox.enableExtensionPack = true;
virtualisation.virtualbox.host.enableHardening = false;
users.extraUsers = {
virtual = {
name = "virtual";
description = "user for running VirtualBox";
home = "/home/virtual";
useDefaultShell = true;
extraGroups = [ "vboxusers" "audio" "video" ];
createHome = true;
};
};
security.sudo.extraConfig = ''
${mainUser.name} ALL=(virtual) NOPASSWD: ALL
'';
}