2010-01-05 15:32:14 +00:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
with pkgs.lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
dmcfg = config.services.xserver.displayManager;
|
|
|
|
cfg = dmcfg.auto;
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
###### interface
|
|
|
|
|
|
|
|
options = {
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2010-01-05 15:32:14 +00:00
|
|
|
services.xserver.displayManager.auto = {
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2010-01-05 15:32:14 +00:00
|
|
|
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 {
|
|
|
|
|
2011-02-17 14:38:02 +00:00
|
|
|
services.xserver.displayManager.slim.enable = false;
|
2011-09-14 19:20:50 +01:00
|
|
|
|
2010-01-05 15:32:14 +00:00
|
|
|
services.xserver.displayManager.job =
|
|
|
|
{ execCmd =
|
|
|
|
''
|
2010-06-01 20:44:23 +01:00
|
|
|
exec ${pkgs.xorg.xinit}/bin/xinit \
|
2010-01-05 15:32:14 +00:00
|
|
|
${pkgs.su}/bin/su -c ${dmcfg.session.script} ${cfg.user} \
|
|
|
|
-- ${dmcfg.xserverBin} ${dmcfg.xserverArgs}
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|