mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-16 18:53:17 +00:00
eb6e1310b8
svn path=/nixos/trunk/; revision=29285
49 lines
719 B
Nix
49 lines
719 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";
|
|
};
|
|
|
|
};
|
|
|
|
}
|