2009-04-13 11:55:41 +01:00
|
|
|
{pkgs, config, ...}:
|
|
|
|
|
2009-08-16 15:49:14 +01:00
|
|
|
with pkgs.lib;
|
2009-04-13 11:55:41 +01:00
|
|
|
|
|
|
|
let
|
2009-08-16 15:49:14 +01:00
|
|
|
|
|
|
|
dmcfg = config.services.xserver.displayManager;
|
2009-04-13 11:55:41 +01:00
|
|
|
cfg = dmcfg.kdm;
|
|
|
|
|
|
|
|
inherit (pkgs.kde42) kdebase_workspace;
|
|
|
|
|
2009-09-02 19:35:23 +01: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 15:49:14 +01:00
|
|
|
kdmrc = pkgs.stdenv.mkDerivation {
|
2009-04-13 11:55:41 +01:00
|
|
|
name = "kdmrc";
|
2009-09-02 19:35:23 +01:00
|
|
|
config = defaultConfig + cfg.extraConfig;
|
|
|
|
buildCommand =
|
|
|
|
''
|
|
|
|
echo "$config" > $out
|
|
|
|
cat ${kdebase_workspace}/share/config/kdm/kdmrc >> $out
|
|
|
|
'';
|
2009-04-13 11:55:41 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2009-08-16 15:49:14 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
###### interface
|
|
|
|
|
|
|
|
options = {
|
2009-04-13 11:55:41 +01:00
|
|
|
|
2009-08-16 15:49:14 +01:00
|
|
|
services.xserver.displayManager.kdm = {
|
2009-09-02 19:35:23 +01:00
|
|
|
|
2009-08-16 15:49:14 +01:00
|
|
|
enable = mkOption {
|
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
Whether to enable the KDE display manager.
|
|
|
|
'';
|
2009-04-13 11:55:41 +01:00
|
|
|
};
|
2009-09-02 19:35:23 +01:00
|
|
|
|
|
|
|
extraConfig = mkOption {
|
|
|
|
default = "";
|
|
|
|
description = ''
|
|
|
|
Options appended to <filename>kdmrc</filename>, the
|
|
|
|
configuration file of KDM.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2009-04-13 11:55:41 +01:00
|
|
|
};
|
2009-08-16 15:49:14 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
|
|
|
|
services.xserver.displayManager.job =
|
2009-09-10 16:49:16 +01:00
|
|
|
{ execCmd = "${kdebase_workspace}/bin/kdm -config ${kdmrc}";
|
2009-08-16 15:49:14 +01:00
|
|
|
};
|
|
|
|
|
2009-09-10 13:37:33 +01:00
|
|
|
security.pam.services = [ { name = "kde"; localLogin = true; ckHack = true; } ];
|
2009-08-16 15:49:14 +01:00
|
|
|
|
2009-04-13 11:55:41 +01:00
|
|
|
};
|
2009-08-16 15:49:14 +01:00
|
|
|
|
2009-04-13 11:55:41 +01:00
|
|
|
}
|