2009-04-13 12:55:41 +02:00
|
|
|
{pkgs, config, ...}:
|
|
|
|
|
2009-08-16 16:49:14 +02:00
|
|
|
with pkgs.lib;
|
2009-04-13 12:55:41 +02:00
|
|
|
|
|
|
|
let
|
2009-08-16 16:49:14 +02:00
|
|
|
|
|
|
|
dmcfg = config.services.xserver.displayManager;
|
2009-04-13 12:55:41 +02:00
|
|
|
cfg = dmcfg.kdm;
|
|
|
|
|
|
|
|
inherit (pkgs.kde42) kdebase_workspace;
|
|
|
|
|
2009-09-02 20:35:23 +02:00
|
|
|
defaultConfig =
|
|
|
|
''
|
|
|
|
[Shutdown]
|
|
|
|
HaltCmd=${pkgs.upstart}/sbin/halt
|
|
|
|
RebootCmd=${pkgs.upstart}/sbin/reboot
|
|
|
|
|
|
|
|
[X-*-Core]
|
|
|
|
Xrdb=${pkgs.xlibs.xrdb}/bin/xrdb
|
|
|
|
SessionsDirs=${dmcfg.session.desktops}
|
|
|
|
FailsafeClient=${pkgs.xterm}/bin/xterm
|
|
|
|
|
|
|
|
[X-:*-Core]
|
|
|
|
ServerCmd=${dmcfg.xserverBin} ${dmcfg.xserverArgs}
|
|
|
|
|
|
|
|
[X-*-Greeter]
|
|
|
|
HiddenUsers=root,nixbld1,nixbld2,nixbld3,nixbld4,nixbld5,nixbld6,nixbld7,nixbld8,nixbld9,nixbld10
|
|
|
|
PluginsLogin=${kdebase_workspace}/lib/kde4/kgreet_classic.so
|
|
|
|
'';
|
|
|
|
|
2009-08-16 16:49:14 +02:00
|
|
|
kdmrc = pkgs.stdenv.mkDerivation {
|
2009-04-13 12:55:41 +02:00
|
|
|
name = "kdmrc";
|
2009-09-02 20:35:23 +02:00
|
|
|
config = defaultConfig + cfg.extraConfig;
|
|
|
|
buildCommand =
|
|
|
|
''
|
|
|
|
echo "$config" > $out
|
|
|
|
cat ${kdebase_workspace}/share/config/kdm/kdmrc >> $out
|
|
|
|
'';
|
2009-04-13 12:55:41 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2009-08-16 16:49:14 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
###### interface
|
|
|
|
|
|
|
|
options = {
|
2009-04-13 12:55:41 +02:00
|
|
|
|
2009-08-16 16:49:14 +02:00
|
|
|
services.xserver.displayManager.kdm = {
|
2009-09-02 20:35:23 +02:00
|
|
|
|
2009-08-16 16:49:14 +02:00
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
Whether to enable the KDE display manager.
|
|
|
|
'';
|
2009-04-13 12:55:41 +02:00
|
|
|
};
|
2009-09-02 20:35:23 +02:00
|
|
|
|
|
|
|
extraConfig = mkOption {
|
|
|
|
default = "";
|
|
|
|
description = ''
|
|
|
|
Options appended to <filename>kdmrc</filename>, the
|
|
|
|
configuration file of KDM.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2009-04-13 12:55:41 +02:00
|
|
|
};
|
2009-08-16 16:49:14 +02:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
|
|
|
|
services.xserver.displayManager.job =
|
2009-09-10 17:49:16 +02:00
|
|
|
{ execCmd = "${kdebase_workspace}/bin/kdm -config ${kdmrc}";
|
2009-08-16 16:49:14 +02:00
|
|
|
};
|
|
|
|
|
2009-09-10 14:37:33 +02:00
|
|
|
security.pam.services = [ { name = "kde"; localLogin = true; ckHack = true; } ];
|
2009-08-16 16:49:14 +02:00
|
|
|
|
2009-04-13 12:55:41 +02:00
|
|
|
};
|
2009-08-16 16:49:14 +02:00
|
|
|
|
2009-04-13 12:55:41 +02:00
|
|
|
}
|