* Added an "auto" pseudo display manager that logs in a user

automatically.  This is mostly useful for testing.  (KDM also has
  this feature, but it's nice not to depend on KDE for non-KDE tests.)

svn path=/nixos/trunk/; revision=19239
This commit is contained in:
Eelco Dolstra 2010-01-05 15:32:14 +00:00
parent 62476f2816
commit 73668f41da
5 changed files with 72 additions and 18 deletions

View File

@ -112,12 +112,14 @@
./services/x11/desktop-managers/none.nix
./services/x11/desktop-managers/xterm.nix
./services/x11/display-managers/default.nix
./services/x11/display-managers/auto.nix
./services/x11/display-managers/kdm.nix
./services/x11/display-managers/slim.nix
./services/x11/hardware/synaptics.nix
./services/x11/hardware/wacom.nix
./services/x11/window-managers/compiz.nix
./services/x11/window-managers/default.nix
./services/x11/window-managers/icewm.nix
./services/x11/window-managers/kwm.nix
./services/x11/window-managers/metacity.nix
./services/x11/window-managers/none.nix

View File

@ -1,14 +1,7 @@
{
services = {
xserver = {
desktopManager = {
session = [{
name = "none";
services.xserver.desktopManager.session =
[ { name = "none";
start = "";
}];
};
};
};
}
];
}

View File

@ -0,0 +1,55 @@
{ config, pkgs, ... }:
with pkgs.lib;
let
dmcfg = config.services.xserver.displayManager;
cfg = dmcfg.auto;
in
{
###### interface
options = {
services.xserver.displayManager.auto = {
enable = mkOption {
default = false;
description = ''
Whether to enable the fake "auto" display manager, which
automatically logs in the user specified in the
<option>user</option> option. This is mostly useful for
automated tests.
'';
};
user = mkOption {
default = "root";
description = "The user account to login automatically.";
};
};
};
###### implementation
config = mkIf cfg.enable {
services.xserver.displayManager.job =
{ execCmd =
''
${pkgs.xorg.xinit}/bin/xinit \
${pkgs.su}/bin/su -c ${dmcfg.session.script} ${cfg.user} \
-- ${dmcfg.xserverBin} ${dmcfg.xserverArgs}
'';
};
};
}

View File

@ -72,7 +72,7 @@ in
enableXDMCP = mkOption {
default = false;
description = ''
Whether to enable XDMCP, which allows remote logins";
Whether to enable XDMCP, which allows remote logins.
'';
};

View File

@ -6,7 +6,15 @@
{ config, pkgs, ... }:
{ services.xserver.enable = true;
environment.systemPackages = [ pkgs.icewm pkgs.firefox ];
services.xserver.displayManager.slim.enable = false;
services.xserver.displayManager.auto.enable = true;
services.xserver.windowManager.default = "icewm";
services.xserver.windowManager.icewm.enable = true;
services.xserver.desktopManager.default = "none";
environment.systemPackages = [ pkgs.firefox ];
};
testScript =
@ -15,10 +23,6 @@
sleep 10;
$machine->execute("DISPLAY=:0.0 icewm &");
sleep 10;
$machine->execute("DISPLAY=:0.0 HOME=/root firefox file://${pkgs.valgrind}/share/doc/valgrind/html/index.html &");
sleep 30;