From 6a0d21eb86105ac8e631621e9425eabbab3c0a1d Mon Sep 17 00:00:00 2001 From: Jussi Maki Date: Wed, 13 May 2015 08:31:32 +0000 Subject: VMWare guest support and open-vm-tools package --- nixos/modules/module-list.nix | 1 + nixos/modules/virtualisation/vmware-guest.nix | 47 +++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 nixos/modules/virtualisation/vmware-guest.nix (limited to 'nixos/modules') diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index bf70715cea4..c1677ff0573 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -460,5 +460,6 @@ ./virtualisation/openvswitch.nix ./virtualisation/parallels-guest.nix ./virtualisation/virtualbox-guest.nix + ./virtualisation/vmware-guest.nix ./virtualisation/xen-dom0.nix ] diff --git a/nixos/modules/virtualisation/vmware-guest.nix b/nixos/modules/virtualisation/vmware-guest.nix new file mode 100644 index 00000000000..3f19f6a28b2 --- /dev/null +++ b/nixos/modules/virtualisation/vmware-guest.nix @@ -0,0 +1,47 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.vmwareGuest; + open-vm-tools = pkgs.open-vm-tools; +in +{ + options = { + services.vmwareGuest.enable = mkEnableOption "Enable VMWare Guest Support"; + }; + + config = mkIf cfg.enable { + assertions = [ { + assertion = pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64; + message = "VMWare guest is not currently supported on ${pkgs.stdenv.system}"; + } ]; + + environment.systemPackages = [ open-vm-tools ]; + + systemd.services.vmware = + { description = "VMWare Guest Service"; + wantedBy = [ "multi-user.target" ]; + serviceConfig.ExecStart = "${open-vm-tools}/bin/vmtoolsd"; + }; + + services.xserver = { + videoDrivers = mkOverride 50 [ "vmware" ]; + + config = '' + Section "InputDevice" + Identifier "VMMouse" + Driver "vmmouse" + EndSection + ''; + + serverLayoutSection = '' + InputDevice "VMMouse" + ''; + + displayManager.sessionCommands = '' + ${open-vm-tools}/bin/vmware-user-suid-wrapper + ''; + }; + }; +} -- cgit 1.4.1