uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
93
nixos/modules/virtualisation/virtualbox-guest.nix
Normal file
93
nixos/modules/virtualisation/virtualbox-guest.nix
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
# Module for VirtualBox guests.
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
cfg = config.virtualisation.virtualbox.guest;
|
||||
kernel = config.boot.kernelPackages;
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
###### interface
|
||||
|
||||
options.virtualisation.virtualbox.guest = {
|
||||
enable = mkOption {
|
||||
default = false;
|
||||
type = types.bool;
|
||||
description = "Whether to enable the VirtualBox service and other guest additions.";
|
||||
};
|
||||
|
||||
x11 = mkOption {
|
||||
default = true;
|
||||
type = types.bool;
|
||||
description = "Whether to enable x11 graphics";
|
||||
};
|
||||
};
|
||||
|
||||
###### implementation
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [{
|
||||
assertions = [{
|
||||
assertion = pkgs.stdenv.hostPlatform.isx86;
|
||||
message = "Virtualbox not currently supported on ${pkgs.stdenv.hostPlatform.system}";
|
||||
}];
|
||||
|
||||
environment.systemPackages = [ kernel.virtualboxGuestAdditions ];
|
||||
|
||||
boot.extraModulePackages = [ kernel.virtualboxGuestAdditions ];
|
||||
|
||||
boot.supportedFilesystems = [ "vboxsf" ];
|
||||
boot.initrd.supportedFilesystems = [ "vboxsf" ];
|
||||
|
||||
users.groups.vboxsf.gid = config.ids.gids.vboxsf;
|
||||
|
||||
systemd.services.virtualbox =
|
||||
{ description = "VirtualBox Guest Services";
|
||||
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
requires = [ "dev-vboxguest.device" ];
|
||||
after = [ "dev-vboxguest.device" ];
|
||||
|
||||
unitConfig.ConditionVirtualization = "oracle";
|
||||
|
||||
serviceConfig.ExecStart = "@${kernel.virtualboxGuestAdditions}/bin/VBoxService VBoxService --foreground";
|
||||
};
|
||||
|
||||
services.udev.extraRules =
|
||||
''
|
||||
# /dev/vboxuser is necessary for VBoxClient to work. Maybe we
|
||||
# should restrict this to logged-in users.
|
||||
KERNEL=="vboxuser", OWNER="root", GROUP="root", MODE="0666"
|
||||
|
||||
# Allow systemd dependencies on vboxguest.
|
||||
SUBSYSTEM=="misc", KERNEL=="vboxguest", TAG+="systemd"
|
||||
'';
|
||||
} (mkIf cfg.x11 {
|
||||
services.xserver.videoDrivers = [ "vmware" "virtualbox" "modesetting" ];
|
||||
|
||||
services.xserver.config =
|
||||
''
|
||||
Section "InputDevice"
|
||||
Identifier "VBoxMouse"
|
||||
Driver "vboxmouse"
|
||||
EndSection
|
||||
'';
|
||||
|
||||
services.xserver.serverLayoutSection =
|
||||
''
|
||||
InputDevice "VBoxMouse"
|
||||
'';
|
||||
|
||||
services.xserver.displayManager.sessionCommands =
|
||||
''
|
||||
PATH=${makeBinPath [ pkgs.gnugrep pkgs.which pkgs.xorg.xorgserver.out ]}:$PATH \
|
||||
${kernel.virtualboxGuestAdditions}/bin/VBoxClient-all
|
||||
'';
|
||||
})]);
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue