summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorArseniy Seroka <jagajaga@users.noreply.github.com>2015-05-15 15:13:30 +0300
committerArseniy Seroka <jagajaga@users.noreply.github.com>2015-05-15 15:13:30 +0300
commit0b3e2beccac16833395d7d78b9b4df8bb4bb307d (patch)
treef472004a60c1acfa19eb40cbb5a6dc351720f66c /nixos
parent2bf516613d88dc16e9185bc0bb1f0e021fbd9442 (diff)
parent6a0d21eb86105ac8e631621e9425eabbab3c0a1d (diff)
downloadnixlib-0b3e2beccac16833395d7d78b9b4df8bb4bb307d.tar
nixlib-0b3e2beccac16833395d7d78b9b4df8bb4bb307d.tar.gz
nixlib-0b3e2beccac16833395d7d78b9b4df8bb4bb307d.tar.bz2
nixlib-0b3e2beccac16833395d7d78b9b4df8bb4bb307d.tar.lz
nixlib-0b3e2beccac16833395d7d78b9b4df8bb4bb307d.tar.xz
nixlib-0b3e2beccac16833395d7d78b9b4df8bb4bb307d.tar.zst
nixlib-0b3e2beccac16833395d7d78b9b4df8bb4bb307d.zip
Merge pull request #7829 from joamaki/vmware_guest
VMWare guest support and open-vm-tools package
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/virtualisation/vmware-guest.nix47
2 files changed, 48 insertions, 0 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index b9fa727f7c00..043b0470edf2 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -463,5 +463,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 000000000000..3f19f6a28b2b
--- /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
+        '';
+    };
+  };
+}