summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorJussi Maki <jussi.maki@vilea.ch>2015-05-13 08:31:32 +0000
committerJussi Maki <jussi.maki@vilea.ch>2015-05-15 12:43:21 +0200
commit6a0d21eb86105ac8e631621e9425eabbab3c0a1d (patch)
tree057dbf6cb32b4c2e80077dc09ecc449eb35babd2 /nixos/modules
parent75ebc3cf1dc1365be5a05018fc8e5409c66025cb (diff)
downloadnixpkgs-6a0d21eb86105ac8e631621e9425eabbab3c0a1d.tar
nixpkgs-6a0d21eb86105ac8e631621e9425eabbab3c0a1d.tar.gz
nixpkgs-6a0d21eb86105ac8e631621e9425eabbab3c0a1d.tar.bz2
nixpkgs-6a0d21eb86105ac8e631621e9425eabbab3c0a1d.tar.lz
nixpkgs-6a0d21eb86105ac8e631621e9425eabbab3c0a1d.tar.xz
nixpkgs-6a0d21eb86105ac8e631621e9425eabbab3c0a1d.tar.zst
nixpkgs-6a0d21eb86105ac8e631621e9425eabbab3c0a1d.zip
VMWare guest support and open-vm-tools package
Diffstat (limited to 'nixos/modules')
-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 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
+        '';
+    };
+  };
+}