nixpkgs/modules/services/x11/display-managers/auto.nix
Eelco Dolstra 45d8c418b5 * Some hackery to get ConsoleKit to work with the SLIM and "auto"
display managers.  This was broken due to a change in ConsoleKit
  0.4.2:

    https://bugs.freedesktop.org/show_bug.cgi?id=28377

  Using ConsoleKit's pam-ck-connector helps in that it creates local
  sessions; however, they're not marked as active because the
  x11-display-device property is not set.  As a workaround, calling
  ck-launch-session seems to work.

  More details:

    https://bugs.gentoo.org/show_bug.cgi?id=336634
    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=598150
    https://bugzilla.redhat.com/show_bug.cgi?id=585952

svn path=/nixos/trunk/; revision=28400
2011-08-08 19:28:17 +00:00

63 lines
1.3 KiB
Nix

{ 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.slim.enable = false;
services.xserver.displayManager.job =
{ execCmd =
''
exec ${pkgs.xorg.xinit}/bin/xinit \
${pkgs.su}/bin/su -c ${dmcfg.session.script} ${cfg.user} \
-- ${dmcfg.xserverBin} ${dmcfg.xserverArgs}
'';
};
# The ConsoleKit PAM connector launches a local session, but it's
# not set as "active" (maybe because x11-display-device is not
# set). Launching a child session seems to fix that.
services.xserver.displayManager.forceCKSession = true;
};
}