mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-18 11:44:07 +00:00
10a3bd6ffe
svn path=/nixos/trunk/; revision=23672
47 lines
670 B
Nix
47 lines
670 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 = [ ];
|
|
|
|
jobs.virtualbox =
|
|
{ description = "VirtualBox service";
|
|
|
|
startOn = "started udev";
|
|
|
|
exec = "${pkgs.linuxPackages.virtualboxGuestAdditions}/sbin/VBoxService";
|
|
};
|
|
|
|
};
|
|
|
|
}
|