From 53bd25c7facbd176881b5aa884afb4b5c9914e06 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 16 Mar 2012 01:29:51 +0000 Subject: [PATCH] * Automatically start VBoxClient-all when the X session starts. This allows seamless windows, resizing of the desktop, cut and paster, etc. svn path=/nixos/trunk/; revision=33131 --- modules/services/x11/display-managers/default.nix | 12 ++++++++++++ modules/virtualisation/virtualbox-guest.nix | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/modules/services/x11/display-managers/default.nix b/modules/services/x11/display-managers/default.nix index 2261d417d04f..cdfd271ee65c 100644 --- a/modules/services/x11/display-managers/default.nix +++ b/modules/services/x11/display-managers/default.nix @@ -80,6 +80,8 @@ let source /etc/profile + ${cfg.displayManager.sessionCommands} + # Allow the user to setup a custom session type. if test -x ~/.xsession; then exec ~/.xsession @@ -164,6 +166,16 @@ in apply = toString; }; + sessionCommands = mkOption { + default = ""; + example = + '' + xmessage "Hello World!" & + ''; + type = types.string; + description = "Shell commands executed just before the window or desktop manager is started."; + }; + session = mkOption { default = []; example = [ diff --git a/modules/virtualisation/virtualbox-guest.nix b/modules/virtualisation/virtualbox-guest.nix index 9f215e816563..04fca1eb4e98 100644 --- a/modules/virtualisation/virtualbox-guest.nix +++ b/modules/virtualisation/virtualbox-guest.nix @@ -60,6 +60,11 @@ in InputDevice "VBoxMouse" ''; + services.xserver.displayManager.sessionCommands = + '' + PATH=${makeSearchPath "bin" [ pkgs.gnugrep pkgs.which pkgs.xorg.xorgserver ]}:$PATH \ + ${kernel.virtualboxGuestAdditions}/bin/VBoxClient-all + ''; }; }