* 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:
parent
62476f2816
commit
73668f41da
|
@ -112,12 +112,14 @@
|
||||||
./services/x11/desktop-managers/none.nix
|
./services/x11/desktop-managers/none.nix
|
||||||
./services/x11/desktop-managers/xterm.nix
|
./services/x11/desktop-managers/xterm.nix
|
||||||
./services/x11/display-managers/default.nix
|
./services/x11/display-managers/default.nix
|
||||||
|
./services/x11/display-managers/auto.nix
|
||||||
./services/x11/display-managers/kdm.nix
|
./services/x11/display-managers/kdm.nix
|
||||||
./services/x11/display-managers/slim.nix
|
./services/x11/display-managers/slim.nix
|
||||||
./services/x11/hardware/synaptics.nix
|
./services/x11/hardware/synaptics.nix
|
||||||
./services/x11/hardware/wacom.nix
|
./services/x11/hardware/wacom.nix
|
||||||
./services/x11/window-managers/compiz.nix
|
./services/x11/window-managers/compiz.nix
|
||||||
./services/x11/window-managers/default.nix
|
./services/x11/window-managers/default.nix
|
||||||
|
./services/x11/window-managers/icewm.nix
|
||||||
./services/x11/window-managers/kwm.nix
|
./services/x11/window-managers/kwm.nix
|
||||||
./services/x11/window-managers/metacity.nix
|
./services/x11/window-managers/metacity.nix
|
||||||
./services/x11/window-managers/none.nix
|
./services/x11/window-managers/none.nix
|
||||||
|
|
|
@ -1,14 +1,7 @@
|
||||||
{
|
{
|
||||||
services = {
|
services.xserver.desktopManager.session =
|
||||||
xserver = {
|
[ { name = "none";
|
||||||
|
start = "";
|
||||||
desktopManager = {
|
}
|
||||||
session = [{
|
];
|
||||||
name = "none";
|
|
||||||
start = "";
|
|
||||||
}];
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
55
modules/services/x11/display-managers/auto.nix
Normal file
55
modules/services/x11/display-managers/auto.nix
Normal 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}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
|
@ -72,7 +72,7 @@ in
|
||||||
enableXDMCP = mkOption {
|
enableXDMCP = mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
description = ''
|
description = ''
|
||||||
Whether to enable XDMCP, which allows remote logins";
|
Whether to enable XDMCP, which allows remote logins.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,15 @@
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
{ services.xserver.enable = true;
|
{ 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 =
|
testScript =
|
||||||
|
@ -15,10 +23,6 @@
|
||||||
|
|
||||||
sleep 10;
|
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 &");
|
$machine->execute("DISPLAY=:0.0 HOME=/root firefox file://${pkgs.valgrind}/share/doc/valgrind/html/index.html &");
|
||||||
|
|
||||||
sleep 30;
|
sleep 30;
|
||||||
|
|
Loading…
Reference in a new issue