nixpkgs/modules/services/misc/virtualbox.nix
David Guibert 96304c9afc make the virtualbox guest module loadable by modprobe.
svn path=/nixos/trunk/; revision=28436
2011-08-09 19:53:01 +00:00

49 lines
751 B
Nix

# VirtualBox server
{ config, pkgs, ... }:
with pkgs.lib;
let
cfg = config.services.virtualbox;
in
{
###### interface
options = {
services.virtualbox = {
enable = mkOption {
default = false;
description = "Whether to enable the VirtualBox service and other guest additions.";
};
};
};
###### implementation
config = mkIf cfg.enable {
environment.systemPackages = [ ];
boot.extraModulePackages = [ pkgs.linuxPackages.virtualboxGuestAdditions ];
jobs.virtualbox =
{ description = "VirtualBox service";
startOn = "started udev";
exec = "${pkgs.linuxPackages.virtualboxGuestAdditions}/sbin/VBoxService";
};
};
}